• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfdocument dynamic margin?

New Here ,
Jul 23, 2008 Jul 23, 2008

Copy link to clipboard

Copied

Hi there.

I am trying to write an Invoice PDF generator in CF8 whereby it gets some data from the DB and converts it to a PDF document. I am using XHTML and CSS to layout the data and then using cfdocument to generate the PDF.

My problem is with the cfdocument margin functionality. For our invoices, the first page will always have an Invoice Header with a lot of detail and subsequent pages for that invoice will have shorter page headers will less detail so the margin needs to change as required.

I have tried many different ways but there doesn’t seem to be any way of making those margin parameters dynamic! They need to be set as an absolute value in the cfdocumentsection (or cfdocument) tag otherwise it defaults to the 0.5in height and everything shrinks down.

I would be most grateful if someone could advise me on a way to get around this issue.

Thanks,
Shama
TOPICS
Advanced techniques

Views

567

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 24, 2008 Jul 24, 2008

Copy link to clipboard

Copied

Just to make my problem easier to understand and replicate, here's the code attached for a simple example file that would reproduce the issue I am having.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 28, 2008 Jul 28, 2008

Copy link to clipboard

Copied

CF8's PDF functionality is based on the iText java library. google for itext margin - you can call the iText classes and methods directly using CF's createObject().

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 28, 2008 Jul 28, 2008

Copy link to clipboard

Copied

LATEST

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation