html - HMTL/CSS border on variable content for PDF problems with page break -
i making .erb html document pdf. have header, content , footer. pdfs created rails gem wickedpdf.
my content generated via embedded ruby code, meaning there isn't fixed length of content or fixed number of lines. want border around page/my content.
right now, border go around whole content, bad page breaks, since box have not close @ end of page instead closes @ end of content , don't want that.
my code pdf creation of content looks this:
<div style="border: 1px solid #000"> srohfs.each |srohf| content = getbodyfromhtml(srohf.content.to_s).gsub(/\s+/, " ").strip content = '<p>' + content + '</p>' if(!content.include?('<p>')) %> <div style="page-break-inside:avoid; display:block;margin: 0px 40px 0 40px;"> <%= content %> </div> <% end %> </div>
if place border style in inner div, every piece of content gets own box, not want.
is there solution this? searching online, maybe indicator of page-break or "do before page break" no such luck. know of way?
Comments
Post a Comment