Copy link to clipboard
Copied
Hi all, I have a problem generating pdf files.
I use Coldfusion 2016 update 11 and <cfdocument format="PDF"> to generate a pdf document.
If I set pageheight to 2.5 centimeters, I got this error:
The valid size must be equal to or greater than 2 inches (5.1 centimeters).
There are some limits in pagesize?
Thank you very much
Copy link to clipboard
Copied
In cfdocument the default pageType is "letter". You get an error because you set a pageHeight of 2.5 cm to the Letter pageType. So, use the attribute pageType="custom".
Anyway, do you really want to have a PDF document with such a small page height?
Copy link to clipboard
Copied
I already used pagetype="custom" with pagewidth and pageheight, but I got the same error.
I set this size because I need to generate labels to print with Dymo LabelWriter 450.
Copy link to clipboard
Copied
This is my code:
<cfoutput>
<cfdocument format="PDF" filename="label.pdf" overwrite="true" orientation="portrait" pagetype="custom" pagewidth="5.4" pageheight="2.5" fontembed="true" margintop="0.1" marginbottom="0.1" marginleft="0.1" marginright="0.1" unit="cm">
<body style="margin:10px 0px 0px 0px;padding:0px 0px 0px 0px;">
<style type="text/css">
.etichetta {
font-family: 'Calibri';
font-size: 36pt;
line-height: 40%;
}
.etichetta-barcode {
font-family: '3 of 9 barcode';
font-size: 48pt;
line-height: 100%;
margin-top: 10px;
transform: scaleY(2);
}
</style>
<cfloop index="i" from="53700" to="53710">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" align="center">
<p class="etichetta-barcode">*SID00#i#*</p>
<p class="etichetta">SID00#i#</p>
</td>
</tr>
</table>
<cfdocumentitem type="pagebreak" />
</cfloop>
</body>
</cfdocument>
</cfoutput>
Copy link to clipboard
Copied
Hi ilgolem ,
You're right. I have been able to reproduce the error.
Also, when using cfhtmltopdf. I didn't expect that. 😞
Copy link to clipboard
Copied
From what I can see on the web, the minimum page-size of a PDF is 1 inch, that is, 2.54 cm. Please report a bug.
Copy link to clipboard
Copied
As an alternative tool to generate PDF, try wkhtmlToPDF. You will find an example in my last post in this thread: https://community.adobe.com/t5/coldfusion/cfdocument-processing-speedtest-results-and-inquiry/td-p/1...
(ignore the bits about tickcounts and processing time)
Copy link to clipboard
Copied
I found it and I will try to use it.
The custom tag does not have the ability to use the custom page size, but I try to add it by myself.
Copy link to clipboard
Copied
Thank you for testing.
I reported the bug.
Regards