CFDocument Margins

I recently updated my server and none of the margins in CFDOCUMENT work anymore. I can set them to 0, 1, 10 or 100 and nothing changes. I tried changing paper size, custom paper, cm and inches; anything I can think of. I tried type=“classic” and type=“modern”, the margin is always the same as if I put nothing in at all. I tried 5.3.7.47 and also 5.3.8.138-SNAPSHOT and neither make a difference.

OS: Centos 7 [Linux (3.10.0-1160.11.1.el7.x86_64) 64bit]
Java Version: 11.0.7 (AdoptOpenJDK) 64bit
Tomcat Version: Apache Tomcat/9.0.35
Lucee Version: 5.3.7.47 and 5.3.8.138-SNAPSHOT

@Robert_Dodge cfdocument margin support for both type classic and modern. what is your PDF extension version? If possible share your test code.

Here is a code example:

<cfdocument  orientation="portrait" pagetype="Custom" pagewidth="2" pageheight="3" unit="in" margintop="0" marginbottom="0" marginleft="0" marginright="0">
test
</cfdocument>

Here is the file it generates: cfdocument.pdf (973 Bytes)

@Robert_Dodge Please use the orientation attribute after that margin in cfdocument tag. Like as below. It generates the PDF as you expected.

<cfdocument format="pdf" unit="in" margintop="0" marginbottom="0" marginleft="0" marginright="0" orientation="portrait"  pagetype="Custom" pagewidth="2" pageheight="3">
test
</cfdocument>

ok, then is that a bug, given that orientation="portrait" is the default?

Yeah @Zackster, For cfdocument - portrait is a default value for orientation. Seems, margin doesn’t work properly when we use orientation as like above code. So, we’ve to use that after margin attribute.

So, you’ll file a bug?

I’ve filed a bug LDEV-3240

1 Like

Thank you for filing it. Anyone have a guess where the last version I could downgrade to that it would work correctly?

To answer my own question, I downgraded to PDF Extension version 1.0.0.80 and the margins worked, but I still had problems with many of my PDFs. It seemed like it was still adding a pretty sizable gap in my <BR>s. Downgrading to 1.0.0.75 made all my PDFs work again. We make a lot of stickers with CFDocument, so spacing is very important to us.