Text cut off when generate pdf file from html - ruby-on-rails

I need generate pdf file from html, now I use gem https://github.com/Studiosity/grover
Content is dynamic, but now I see text often cut off on bottom of page. Anyone can help me ?

Please check this doc, You should make some changes in your views to make them possible to fit in PDF's. It probably something like, converting every paragraph to a container that holds one. And the CSS page-break-inside Property will be helpful for you to not to break crossed over to the content but at the place where block starts or ends.
I think, what is being cutted off is as same as what happens when you try to print the page. This way, you can debug it.

Related

autoPaging in jsPdf .html() method

I have updated jsPdf to version "jspdf": "^2.4.0", and saw an option called autoPaging in the html() method of jspdf, anyone knows what is it used for ? I tried using it but didnt see anything different on the generated pdf.
I am guessing it might be related to paging like "Page 1 of 2".
As jspdf documentation:
Autopaging is used to set the auto paging mode.
false: Auto paging is disabled.
true or 'slice': Will cut shapes or text chunks across page breaks. Will possibly slice text in half, making it difficult to read.
'text': Trys not to cut text in half across page breaks. Works best for documents consisting mostly of a single column of text.
Default is true.

Best way to link images to text so that localization keeps things spaced properly?

I've got an app with a big 'help' page that describes how to use it. This page features a lot of text with some embedded images. Is there some way to 'link' or attach these images to the bottom of specific text boxes so things will lay out reasonably well for any localization we do? In other words, if the French translation of a block of text ends up being two lines longer than the English equivalent, I'd like the image that's placed below that text to be pushed downward by the appropriate amount without having to re-edit the layout of of the .xib file manually. Possible?
You can make HTML page. You can place any thing after your text and can do modification. As it is HTML page it can easily wrap and auto adjust itself. And show the html page in your webview by saving the HTML page in your local data storage

Hiding embedded tweet until Twitter JS loaded

I'm trying out the new embed Tweet feature https://dev.twitter.com/docs/embedded-tweets and it renders horribly until presumably the js file is run and it styles the Tweet. I'd like to hide the Tweet until it is properly styled. Is this possible? I've moved the js file towards the top of the head section to try to get it loaded early.
The example is at http://www.photogenix.biz - I've put it inside a container div with width and min-height set to try to control the horribleness :) Any advice at all? If code is involved I would really need it as specific as possible.

SIRF3 and styleSwitcher, how to force the font.swf to reload in the browser cache?

Alright after having searched thr whole web for my answer, I hope to have someone to help me on this plezzzz.
I'm working with a php styleswitcher to give my website a day/night look and i'm using 2 sifr-config files to handle the color changes needed for the text to keep be readble on both backgrounds color.
(let's say I'm writing in white with a black background and vice-versa)
In theory it's working great, BUT i'm obliged to hit F5 to force the refresh of the sirf SWF on style change, otherwise my browser keeps the same font file all time, I've tried meta no-cache, different variables names, differents swf's, ...I've tried to add a ramdom number at the end of thefont.swf?... I think it could be the solution but it's not working.
Do you see a solution?
Many many thanks!
It sounds like you want to change the sIFR font when the style switches? You'll have to reapply sIFR for this to work, which I guess is what the reload does.
Look into "sIFR rollback" on how to undo the replacements, and then run the replacements again with the new Flash file. You could also try and embed two fonts in one sIFR 3 movie and use the dynamic changeCSS method to switch to the other font family.

sifr alternate text always displays

Using sifr3-r436. First page load of seems fine. Reload page and sifr-alternate text always displays resulting in a double headline, one Flash text one HTML. Any ideas?
Please see example here:
http://v3.kevincarrollkatalyst.com/blog/
It was some kind of CSS problem. Rolling the sifr css properties into my screen and print style sheets fixed the problem.
Most likely it's your SIFR-stylesheet that isn't loaded properly. Please ensure that the path is correct:

Resources