cfdocument and page-break-inside: avoid
I'm curious if anyone has found a way to prevent content blocks converted to PDF with cfdocument from breaking across pages (e.g. a div with content that could be a couple of lines or 30 lines, but I'd like to keep it all together on the same page). I've tried applying the page-break-inside: avoid CSS element but it appears to have no effect. Research on the topic has not wielded anything practical. Some suggest encapsulating the content with cfsavecontent and then counting line breaks to estimate the element height and further, keep track of how much has been output since the beginning or last page break to determine if a manual page break should be inserted. I'd like to find a more elegant solution using existing CSS elements if possible. Any thoughts from PDF-generating ninjas out there? -Justin ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348884 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: cfdocument and page-break-inside: avoid
Justin, I thought it was page-break-after -mark Mark Kruger - CFG CF Webtools www.cfwebtools.com www.coldfusionmuse.com O: 402.408.3733 x105 E: mkru...@cfwebtools.com Skype: markakruger -Original Message- From: Justin Scott [mailto:leviat...@darktech.org] Sent: Sunday, November 27, 2011 2:22 PM To: cf-talk Subject: cfdocument and page-break-inside: avoid I'm curious if anyone has found a way to prevent content blocks converted to PDF with cfdocument from breaking across pages (e.g. a div with content that could be a couple of lines or 30 lines, but I'd like to keep it all together on the same page). I've tried applying the page-break-inside: avoid CSS element but it appears to have no effect. Research on the topic has not wielded anything practical. Some suggest encapsulating the content with cfsavecontent and then counting line breaks to estimate the element height and further, keep track of how much has been output since the beginning or last page break to determine if a manual page break should be inserted. I'd like to find a more elegant solution using existing CSS elements if possible. Any thoughts from PDF-generating ninjas out there? -Justin ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348885 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfdocument and page-break-inside: avoid
The following will work. create the following style: .PB { page-break-after: always; margin-top : 1px; margin-bottom : 1px; } Then anywhere you want the page to break put a paragraph tag w/ a class of PB. On Nov 27, 2011, at 3:22 PM, Justin Scott wrote: I'm curious if anyone has found a way to prevent content blocks converted to PDF with cfdocument from breaking across pages (e.g. a div with content that could be a couple of lines or 30 lines, but I'd like to keep it all together on the same page). I've tried applying the page-break-inside: avoid CSS element but it appears to have no effect. Research on the topic has not wielded anything practical. Some suggest encapsulating the content with cfsavecontent and then counting line breaks to estimate the element height and further, keep track of how much has been output since the beginning or last page break to determine if a manual page break should be inserted. I'd like to find a more elegant solution using existing CSS elements if possible. Any thoughts from PDF-generating ninjas out there? -Justin ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348886 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: cfdocument and page-break-inside: avoid
Nice... who do you work for again? :D -Original Message- From: Kelly Matthews [mailto:webd...@gmail.com] Sent: Sunday, November 27, 2011 2:52 PM To: cf-talk Subject: Re: cfdocument and page-break-inside: avoid The following will work. create the following style: .PB { page-break-after: always; margin-top : 1px; margin-bottom : 1px; } Then anywhere you want the page to break put a paragraph tag w/ a class of PB. On Nov 27, 2011, at 3:22 PM, Justin Scott wrote: I'm curious if anyone has found a way to prevent content blocks converted to PDF with cfdocument from breaking across pages (e.g. a div with content that could be a couple of lines or 30 lines, but I'd like to keep it all together on the same page). I've tried applying the page-break-inside: avoid CSS element but it appears to have no effect. Research on the topic has not wielded anything practical. Some suggest encapsulating the content with cfsavecontent and then counting line breaks to estimate the element height and further, keep track of how much has been output since the beginning or last page break to determine if a manual page break should be inserted. I'd like to find a more elegant solution using existing CSS elements if possible. Any thoughts from PDF-generating ninjas out there? -Justin ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348887 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfdocument and page-break-inside: avoid
Some awesome company named CFWebTools! Run by this guy named Mark Kruger! LOL I'm on vacation, cut me some slack!! :) On Nov 27, 2011, at 4:06 PM, Mark A. Kruger wrote: Nice... who do you work for again? :D -Original Message- From: Kelly Matthews [mailto:webd...@gmail.com] Sent: Sunday, November 27, 2011 2:52 PM To: cf-talk Subject: Re: cfdocument and page-break-inside: avoid The following will work. create the following style: .PB { page-break-after: always; margin-top : 1px; margin-bottom : 1px; } Then anywhere you want the page to break put a paragraph tag w/ a class of PB. On Nov 27, 2011, at 3:22 PM, Justin Scott wrote: I'm curious if anyone has found a way to prevent content blocks converted to PDF with cfdocument from breaking across pages (e.g. a div with content that could be a couple of lines or 30 lines, but I'd like to keep it all together on the same page). I've tried applying the page-break-inside: avoid CSS element but it appears to have no effect. Research on the topic has not wielded anything practical. Some suggest encapsulating the content with cfsavecontent and then counting line breaks to estimate the element height and further, keep track of how much has been output since the beginning or last page break to determine if a manual page break should be inserted. I'd like to find a more elegant solution using existing CSS elements if possible. Any thoughts from PDF-generating ninjas out there? -Justin ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:34 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: cfdocument and page-break-inside: avoid
Ha It never hurts to get a little extra press :) -mark -Original Message- From: Kelly Matthews [mailto:webd...@gmail.com] Sent: Sunday, November 27, 2011 3:14 PM To: cf-talk Subject: Re: cfdocument and page-break-inside: avoid Some awesome company named CFWebTools! Run by this guy named Mark Kruger! LOL I'm on vacation, cut me some slack!! :) On Nov 27, 2011, at 4:06 PM, Mark A. Kruger wrote: Nice... who do you work for again? :D -Original Message- From: Kelly Matthews [mailto:webd...@gmail.com] Sent: Sunday, November 27, 2011 2:52 PM To: cf-talk Subject: Re: cfdocument and page-break-inside: avoid The following will work. create the following style: .PB { page-break-after: always; margin-top : 1px; margin-bottom : 1px; } Then anywhere you want the page to break put a paragraph tag w/ a class of PB. On Nov 27, 2011, at 3:22 PM, Justin Scott wrote: I'm curious if anyone has found a way to prevent content blocks converted to PDF with cfdocument from breaking across pages (e.g. a div with content that could be a couple of lines or 30 lines, but I'd like to keep it all together on the same page). I've tried applying the page-break-inside: avoid CSS element but it appears to have no effect. Research on the topic has not wielded anything practical. Some suggest encapsulating the content with cfsavecontent and then counting line breaks to estimate the element height and further, keep track of how much has been output since the beginning or last page break to determine if a manual page break should be inserted. I'd like to find a more elegant solution using existing CSS elements if possible. Any thoughts from PDF-generating ninjas out there? -Justin ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348889 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfdocument and page-break-inside: avoid
The following will work. create the following style: .PB { page-break-after: always; margin-top : 1px; margin-bottom : 1px; } @Mark and Kelly: Thanks, but that's not what I'm trying to do. Some of the elements I'm outputting are small and I do not want a page break before or after every one of them. I need the PDF engine to put as many on a page as possible, but if there isn't room on the current page to fit the next one, it needs to insert a break and put that next element on the next page (which could then be followed by ten small elements which can also go on that page before another break is needed; forcing breaks before or after each of them would be overkill and add a lot of extra/wasteful pages to the report). The page-break-within CSS element is part of the CSS3 standard which is supposed to do exactly what I need, but cfdocument is ignoring it, unfortunately. Any other thoughts on how to accomplish that functionality? Thanks for jumping into the discussion. -Justin ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348890 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm