Skip to main content
Inspiring
September 22, 2008
Question

cfdocument landscape and portrait together

  • September 22, 2008
  • 3 replies
  • 1443 views
I generate a fairly large document (50 pages on average) make up of many dynamically created report pages often using charts and tables. Some of the reports just look much better portrait and other must use landscape. Logically, the flow requires the pages to be intermiggled (not all portrait pages at the front/back, the are here and there).

I was hoping that cfdocument section had the ability to flip landscape and portrait but I don't see that anywhere.

Does anyone have any ideas on how to do this? I would hate to have to generate 20 different PDF files and then merge them together...

Adobe, this is a important feature request, at least me..
    This topic has been closed for replies.

    3 replies

    Inspiring
    September 23, 2008
    Also,

    (If you are using Coldfusion 8), You can go for the <cfpdf> tag, which has an attribute action="rotate"
    Inspiring
    September 23, 2008
    Daverms wrote:
    > (If you are using Coldfusion 8), You can go for the <cfpdf> tag, which has an attribute action="rotate"

    That would certainly be the preferred method. But where do you see action="rotate"? I only see:
    rotation = "degree of rotation of the watermark"
    gdemariaAuthor
    Inspiring
    September 23, 2008
    wow, cfsearching, that's really interesting!
    If I understand correctly, you're suggesting to use cfdocument in one mode (say portrait) and then flip some pages on their side...

    But I'm wondering if that would work. Let's say I start with Portrait and then choose a few pages that are extra wide. When I print the too-wide page in Portrait, it will be cut off at the margins, then I flip it and it would be portrait-wide in a landscape direction.

    The other thing I am wondering is how will I know which pages I need to flip. When printing a section of a report, I don't know in advance if that section will run one page, two pages or more. So, while building my report, I'm not sure that I can keep track of which pages I need to flip as I won't know their page numbers.

    Thanks, I really appreciate it..
    Inspiring
    September 23, 2008
    gdemaria wrote:
    > If I understand correctly, you're suggesting to use cfdocument in one
    > mode (say portrait) and then flip some pages on their side...

    Yes

    > When I print the too-wide page in Portrait, it will be cut off at the margins,
    > then I flip it and it would be portrait-wide in a landscape direction.

    Possibly. You could also try changing the page size and enlarge it if needed. But test it out with one of your pdf's first to see what results you get.

    > The other thing I am wondering is how will I know which pages I need to flip.

    That is a bit trickier. You might be able to detect the oversize pages pro grammatically. I cannot be 100% sure without seeing one of the files. But it would be more involved than if you were able to keep track of the page numbers.
    Inspiring
    September 23, 2008
    gdemaria wrote:
    > Does anyone have any ideas on how to do this?

    Well if it is not possible with CF, you could always do it with iText.
    Inspiring
    September 23, 2008
    Here is an example that should rotate the first, fifth and twelfth pages of a pdf (if those pages exist).