Inserted Photo and/or Kable Table will not stay where it's placed between text in R markdown - image

I have two things I have been using, neither of which are keeping the image/table exactly where I placed it within the text in R markdown when knitted to a pdf.
![caption](path) will place the image where there is space on the page. That is, if the page has space, the image will print between the desired text. However, if the page does not have the space, the text is placed to fill the page and then the image awkwardly inserts itself in the middle of the paragraph on the next page.
I am having a similar problem with my kable tables. I have tried using latex_options = 'hold_position', but this seems to only keep my tables from grouping together.
Is there a way to have my table stay between the text that I want? So if it needs to start a whole new page, to fit it, it can without trying to fill the space with the text below.
Thank you in advance.

Related

How to insert my 1:100 draw from Autocad into a Word document

I must to insert an 1:100 image I did in Autocad inside a Word document. I just printed in PDF format and it fits a A4. I could do a print screen, paste it on the Word page and crop the boundaries, but it need some very sketchy adjusts to put it back into the correct scale. Also the lines does not render very well. I believe there is a better and correct way to do.
I guess my first question would be, "Why do you need to insert the file into a word document?"
If you must insert it into a word document, you should use the Insert Object process described here -->PDF into Word Doc.
This would never be my preferred method though. I would rather convert the word document to PDF and then insert my scaled PDF drawing into the exported word doc PDF. This would keep the integrity of your drawing scale intact.
Just my two cents, which won't get you much.

How can I get a "break" after an image

Using iTextSharp (4.1.6) in a Xamarin.Forms app.
I have lines of data with CRLF at the end of each. I put these into paragraphs, which I add to the doc. At then end of many, I add to the doc one or more images (photos). Works great.
Now, I'd like to have a page break after the last image, so I get a fresh start.
But iText seems to be flowing the text around the image some, and sometimes I don't get that page break, at last not where I want it. The next paragraph follows immediately after the image.
I tried adding a small paragraph after the image, but this did not solve. I did find that adding a SECTION seems to cause a good break, but puts some text in that I don't want or need.
I don't seem to find anything like API documentation for this, I've been just working from examples.
It seems like this would be really easy. What am I doing wrong?
iText seems to be flowing the text around the image some
Indeed, if you add an image to your document which does not fit on the current page anymore (but there still is some place for text on that page), iText does not immediately start a new page but keeps the image in memory and waits for your next content additions. If you then add text, that text first fills the current page, and only if even text does not fit anymore (or if you add another image), a new page is started and the waiting image is added.
You can switch this off using for your PdfWriter writer using
writer.StrictImageSequence = true;

Fixed row position under expandable row group

I am trying to display text on an SSRS report in a fixed position, regardless of the content above it. The problem is the content above may be one to three lines. As the above content fluctuates, so does the beginning of the next row of content. This happens in two places on the report.
In other words, I need two static starting points for dynamic content. I am printing text onto a pre-designed invoice that doesn't contain any customer data. The invoice is just a template (or shell if you will) and I am to position the data to print into spaces provided on that invoice.
Please see attachments. The attachment with two rows in each field is lining up correctly. I have done this intentionally as a basis. As you can see on the other two attachments, with either one or three rows, the content isn't lining up where it should be due to more or less content than my basis.
I have toyed around with cangrow & canshrink but couldn't get the results as desired.
Appreciate the help!
I think you're going to need to re-work your table to get working the way you want.
The way I would do it would be to have one table that groups each page data. Use this table to format your data - putting Rectangles in the area for your lines of data. Rectangles can have a set height so they fill your area when there isn't enough data.
Then you'll have to add another tables inside each of the rectangles to display each sections data.
See my example below - the RED represents where the Rectangles would go and the BLUE for tables.
I would keep the old table intact and copy and paste it in each rectangle. Then remove all the parts that that section doesn't need and set your rectangle to the correct size.

Displaying images from Google Sheets as a table in a web site

I've created a Google Spreadsheet with logo images in one column of cells, but when I try to create a table to add into my website the images do not display in the table.
I need them to display so The logos are visible within a webpage? Does anyone know why the images are not displaying in table format, or how I can fix this.
Not sure which method did you choose to display images. My solution worked for images embedded with the IMAGE function and not showing inside the new spreadsheets, but showing inside the old. I must admit I haven't tested it with embedded documents but it should work too:
SPACE character is an offending character in the new Google spreadsheets when embedding images using the IMAGE function. Replace it with another, 'safe' character like '-' or '_'
Not sure how much this helps, since I don't know what you did/did wrong, but here's a pasted table with images from the new Google Sheets. The only thing of note is that in the pasted table, all images scale to the cell size with aspect ratios retained, ignoring the parameters in the spreadsheet.
formula: =IMAGE("https://www.google.com/images/srpr/logo3w.png")
copy/pasted into document:
original spreadsheet:

PDF generation under ruby - block should not cut by page separator

My PDF consists of a number of blocks (actually, a list of quotations), they go one after another till the end of the document. If the text of a quotation
does not fit on the page, the whole quotation should start from the top of the next page, instead of being torn apart. How can I implement that on any library under ruby?
Try PrinceXML - this is a standalone executable that generates PDF out of HTML or XML. It supports a lot of special CSS properties that will even help you to control page breaks. Refer to http://www.princexml.com/doc/6.0/page-breaks/
This application is available for windows and linux. I was using it for generation of a pretty complicated PDF documents with headers and footers on every page except first one. And since you don't need to output a PDF with precise positioning of elements, it might be a perfect solution for you.
I haven't tried it, but in Prawn I would try using either the Document#text_box method or looking up the table methods and putting your text in cells with invisible borders. The documentation's unclear on how page break functionality fits in with the bounding box models, but it's worth a shot.
HTMLDoc which converts HTML to PDF has a page break facility.

Resources