Word will add the required section breaks. Change 'Apply to' so that it says 'Selected text' and finally click OK. I created a simple sample app in gitHub which shows the basic functionality for people to play with if that's of help. Then double-click the vertical ruler to display the Page Setup dialog box (or use the dialog launcher button in the Page Setup group on the Layout tab on the ribbon). Maybe there's a simple/obvious solution that I've missed? but I've not dug into how much of a performance hit / effort that would entail. And of course one other was to recreate the PDF dynamically for viewing and make all the pages larger. Last idea was to instead of drawing directly on the page have some sort of pop-up window (like a sticky-note) contain the note but then it would need to be moved dynamically with the scrolling of the page. Another thought was to go to a custom PDFView library but the only ones I found when I last looked were iOS (not Cocoa) based. The obvious (ie, easy) solution is to change the actual "page size" in the PDFView and have wider margins, but of course PDFKit has no support for that (I don't think). I've been looking for a straight-forward solution and would very much appreciate ideas on how to address it. Problem is that with very small margins the comments can be very squished. Once the comment is saved the comment is displayed on the PDFView page in the margin via an overridden draw() function for PDFView. I have a small sample application that allows you to display a page, select a range of text and then associate a comment with that text. I had a two column layout where the text was getting cut off mid-text.This is perhaps a more general question as I'm looking for ideas on how to approach a problem working with PDFView/PDFKit. None of the solutions I found worked for me, but something else did. I scoured the internet for a couple of weeks, trying to overcome this issue. We have to make it easy for the library to detect this by removing as much odd css in there as possible, so it's as simple as possible to calculate down to the pixel where the content lies. I believe ultimately the code is trying to guess as best as it can exactly how many pixels high each page is, and where exactly (down to the pixel) is your content. Then the page-break-inside: avoid was working after that as expected. If you are using a standard PDF font, just pass the name to the font method. It started working and not cutting off either images or tables mid-row once I removed that. If you want to use ur own font: PDFKit supports embedding font files in the TrueType (.ttf), TrueType Collection (.ttc), and Datafork TrueType (.dfont) formats.To change the font used to render text, just call the font method. I made so many tweaks trying to get it to work so I can't be 100% sure, but I believe the issue was it set to 'display:table' with margin: 0 auto and a specific width on the main outer div. 1 omfile ('samplehtmlfile.html', outputpath 'newfile2.pdf', configuration config) You can also create PDF files with more complex HTML / CSS, as well. Then I tweaked css that was on the root div of my html, and it fixed it. The obvious (ie, easy) solution is to change the actual 'page size' in the PDFView and have wider margins, but of course PDFKit has no support for that (I dont think). omstring (s, outputpath 'newfile.pdf', configuration config) Additionally, pdfkit can create PDF files by reading HTML files. Line breaking - Using the generated glyph runs for the paragraph, break into lines using the Unicode line breaking algorithm. I kept tweaking css to play around, trying to throw in page-break avoids everywhere, not having much progress. This can be done using - the library PDFKit already uses. This is old but hopefully will help someone - I was having the issues too, tried everything - even resorting back to old versions mentioned (12.1) but to no avail. HTML documents such that it contains many lines on which pages can be Solution to this problem, until this is solved try organising your Page-break-inside property to remedy this somewhat. If you are using the patched version of QT you can use the CSS Will cut a line into to pieces display the top half on one page. Of text where one is vertically shifted by half a line. Basically webkit will render everything into one long page,Īnd then cut it up into pages. The current page breaking algorithm of WebKit leaves much to beĭesired. According to some documentation I found (see Page Breaking), this is a known issue and suggests using CSS page breaks to insert page breaks (assuming you are using patched version of QT):
0 Comments
Leave a Reply. |