Thanks for the thoughts Charlie. Below is the code I used to produce the PDF. Basically what I'm doing is using CSS absolute positioning to define A4 page with 4x2 labels on it. Then use cfdocument to convert the HTML into PDF.
The PDFs produced are quite different in CF10 and CF8. The margins of the borders are a bit different and also the font size rendered in CF8 is much bigger. Can anyone who still got CF8 try the code below and if you can share some findings/thoughts that will be great? <cfsetting enablecfoutputonly="true"> <cfoutput> <cfdocument format="pdf" pagetype="A4" orientation="landscape" marginleft="0" margintop="0" marginright="0" marginbottom="0"> <!DOCTYPE html> <html lang="en"> <head> <title></title> <meta charset="utf-8"> <style media="all"> body { margin:0px; } /* Reset browser agent default margin to zero as much as possible */ .label { background:white; position:absolute; border-collapse:collapse; width:2.67in; height:3.9in; margin: 0.00in; padding: 0; left: 0.00in; top: 0.00in; border:1px solid ##000000; border-style:dotted; } .paper { position:relative; margin: 0.00in; padding: 0; left: 0.00in; top: 0.00in; width: 11.69in; height: 8.27in; border:1px solid ##000000; border-style:dotted; } /* calibration is required based on printing results */ .label-heading { text-align:center; font-weight:bold; padding: 0.07in 0.00in 0.00in 0.00in; } .label-supp-number-text, .label-cust-number-text, .label-inv-number-text, .label-inv-date-text, .label-cube-text, .label-weight-text { text-align:center; font-size:11px; padding: 0.01in 0.00in 0.01in 0.00in; } .label-supp-number-text span, .label-cust-number-text span, .label-inv-number-text span, .label-inv-date-text span, .label-cube-text span, .label-weight-text span { padding-left: 0.15in; } .label-supp-number-barcode, .label-cust-number-barcode, .label-inv-number-barcode, .label-cube-barcode, .label-weight-barcode { padding: 0.03in 0.01in; text-align:center; } .label-supp-number-barcode img, .label-cust-number-barcode img, .label-inv-number-barcode img, .label-cube-barcode img, .label-weight-barcode img { width: 2.4in; height: 0.38in; } .label-supp-name-text, .label-cust-name-text { text-align:center; font-weight:bold; } .label-carton-count { text-align:center; font-size:11px; padding:0.03in 0.00in 0.01in 0.00in; } .label-carton-count span { font-weight:bold; font-size:26px; padding-left: 0.15in; } .page-break { /*clear: left;*/ display:block; page-break-after:always; margin-bottom:8px; /* This value is worked out from browser agent - FF put default 8px margins on page body */ } </style> </head> <body> <div class="paper"> <div class="label" style="left:0.00in;top:0.00in;margin-left:0.52in;margin-top:0.17in"> <div class="label-heading">ABC INVOICE</div> <div class="label-supp-number-text">ABC NUMBER <span>01234567</span></div> <div class="label-supp-number-barcode"></div> <div class="label-supp-name-text">XYZ COMPANY</div> <div class="label-cust-number-text">CUSTOMER NUMBER <span>01234567</span></div> <div class="label-cust-number-barcode"></div> <div class="label-cust-name-text">SOME TEXT HERE</div> <div class="label-inv-number-text">INVOICE NUMBER <span>123456789</span></div> <div class="label-inv-number-barcode"></div> <div class="label-inv-date-text">INVOICE DATE <span>18/08/2015</span></div> <div class="label-cube-text">ABC <span>12345</span></div> <div class="label-cube-barcode"></div> <div class="label-weight-text">EFG <span>23456</span></div> <div class="label-weight-barcode"></div> <div class="label-carton-count">ABCDEFGXYZ <span>999</span></div> </div> <div class="label" style="left:2.67in;top:0.00in;margin-left:0.52in;margin-top:0.17in">Test Label</div> <div class="label" style="left:5.34in;top:0.00in;margin-left:0.52in;margin-top:0.17in">Test Label</div> <div class="label" style="left:8.01in;top:0.00in;margin-left:0.52in;margin-top:0.17in">Test Label</div> <div class="label" style="left:0.00in;top:4.02in;margin-left:0.52in;margin-top:0.17in">Test Label</div> <div class="label" style="left:2.67in;top:4.02in;margin-left:0.52in;margin-top:0.17in">Test Label</div> <div class="label" style="left:5.34in;top:4.02in;margin-left:0.52in;margin-top:0.17in">Test Label</div> <div class="label" style="left:8.01in;top:4.02in;margin-left:0.52in;margin-top:0.17in">Test Label</div> </div> <div class="page-break"></div> <div class="paper"> <div class="label" style="left:0.00in;top:0.00in;margin-left:0.52in;margin-top:0.17in">Test Label</div> <div class="label" style="left:2.67in;top:0.00in;margin-left:0.52in;margin-top:0.17in">Test Label</div> <div class="label" style="left:5.34in;top:0.00in;margin-left:0.52in;margin-top:0.17in">Test Label</div> <div class="label" style="left:8.01in;top:0.00in;margin-left:0.52in;margin-top:0.17in">Test Label</div> <div class="label" style="left:0.00in;top:4.02in;margin-left:0.52in;margin-top:0.17in">Test Label</div> <div class="label" style="left:2.67in;top:4.02in;margin-left:0.52in;margin-top:0.17in">Test Label</div> <div class="label" style="left:5.34in;top:4.02in;margin-left:0.52in;margin-top:0.17in">Test Label</div> <div class="label" style="left:8.01in;top:4.02in;margin-left:0.52in;margin-top:0.17in">Test Label</div> </div> </body> </html> </cfdocument> </cfoutput> <cfsetting enablecfoutputonly="false"> On Tue, Aug 18, 2015 at 10:34 AM, Charlie Arehart < charlie_li...@carehart.org> wrote: > Xiaofeng, that update you mention (that you have) is not “your latest > update”, and it doesn’t list “all your updates”. It just lists one random > update you have. To find out what updates you DO have, including whether > you have the one for cfdocument, check out this blog post: > > > http://www.carehart.org/blog/client/index.cfm/2012/6/18/what_hotfixes_have_been_applied > > > Then if you don’t have the hotfix needed, give a shot and see if that > fixed your problem (restart CF after putting it in place, of course). > > If you do already have it, or you add it (and restart CF) and it doesn’t > help, here are a couple of thoughts: > > - first, you may find that you’re simply benefiting (in CF10) from some > improvements to CFDOCUMENT, which you may not get in CF8. > - second, you may be suffering a problem due to something related to the > CFIDE folder (especially CFIDE/scripts). CFDocument may well use that to do > its work, and perhaps you have some or all of CFIDE blocked or not updated > properly in CF8 (one could apply a “needed” hotfix to CF8, but do it wrong, > and have issues in the CFIDE folder that affect operations of various > sorts). > > If you have a simple example you can offer (including what its output > looks like when wrong and when right), then perhaps others (still with CF8) > can run it and tell you if it looks “wrong” for them. > > /charlie > > > > *From:* cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] *On > Behalf Of *Xiaofeng Liu > *Sent:* Monday, August 17, 2015 2:20 AM > *To:* cfaussie@googlegroups.com > *Subject:* [cfaussie] cfdocument issue in CF8 - create PDF out of HTML > > > > Hi everyone, > > > > I have some code to create PDF out of HTML by using cfdocument. > > > > It works perfect in CF10 however when I deploy to an old server running > ColdFusion 8, the PDF generated is quite different. It looks like when > cfdocument converts HTML to PDF, the CSS associated with it did not get > converted correctly. > > > > If I just commented out the openning and closing cfdocument tags and > render it as HTML, I can see it got rendered the same on the CF8 and CF10 > servers. So I believe this is a cfdocument issue due to the differences > between the two servers. > > > > I noticed that there is a CF8 hotfix for cfdocument. > > My current server is on *version 8,0,1,195765* with *update > level hf801-71557.jar.* > > I am just wondering has anyone got this hotfix applied and what should be > the update level after applied the cfdocument hotfix? I'm trying to figure > out has my CF8 server actually been patched with the correct hotfix to fix > the cfdocument issue or not. > > > > Any help will be much appreciated. > > > > Thanks, > > Xiaofeng > > -- > You received this message because you are subscribed to the Google Groups > "cfaussie" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to cfaussie+unsubscr...@googlegroups.com. > To post to this group, send email to cfaussie@googlegroups.com. > Visit this group at http://groups.google.com/group/cfaussie. > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "cfaussie" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to cfaussie+unsubscr...@googlegroups.com. > To post to this group, send email to cfaussie@googlegroups.com. > Visit this group at http://groups.google.com/group/cfaussie. > For more options, visit https://groups.google.com/d/optout. > -- Best regards, Xiaofeng,^_^ -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To unsubscribe from this group and stop receiving emails from it, send an email to cfaussie+unsubscr...@googlegroups.com. To post to this group, send email to cfaussie@googlegroups.com. Visit this group at http://groups.google.com/group/cfaussie. For more options, visit https://groups.google.com/d/optout.