Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 886077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:00:43+00:00 2026-05-15T13:00:43+00:00

I am trying to determine if MY xsl:fo generated PDF file will exceed one

  • 0

I am trying to determine if MY xsl:fo generated PDF file will exceed one page or not, without actually generating the output. We use Apache-FOP 0.95 on our server, and the XML data is being generated using a PHP DOMDocument class before being passed onto an XSL-FO template.

My question:

Are there PHP libraries out there that can simulate xsl:fo output and send me reports that I can use in my application?

Alternatively, is there a way for the Apache FOP itself (or sibling Java app) that sends reports without actually generating a file? I have been reading the FOP documentation, and aside from some things I can not fully understand, I have not been able to find a way to do that from within FOP.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T13:00:43+00:00Added an answer on May 15, 2026 at 1:00 pm

    Without actually running the document through the layout engine there’s no possibility to “simulate” the document. Also, different FO processors may produce slightly different output, so you can’t rely on the result from one to guess on the number of pages of another.

    What you can do with Apache FOP 0.95 is generate the so-called Area Tree XML (or intermediate format) which basically outputs the layout result as an XML file instead of a PDF, for example. That XML file could then be inspected using XPath (or XSLT) to determine the number of pages. The XML format is not formally described, but you’ll quickly see how you can determine the number of pages. So, by using “-at application/pdf simulation.xml” instead of “-pdf output.pdf” on the command-line, you can produce that XML format. Of course, most of the processing required to produce the final document needs to be done in this case, so re-running the whole document again for PDF production will cost quite some time. The good news is that you can use the AT XML as input again to produce the final PDF so the layout stage doesn’t have to be run again (see “-atin” parameter in the documentation).

    Another possibility is, of course, to just use a PDF tool to determine the number of pages of the final document.

    HTH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to generate a PDF using XSL(XML-FO) to transform a generated XML
I'm trying to determine the best way to implement a 404 page in a
I am trying to determine if the an element in one multi-dimensional array exists
Im trying to determine where a shot will hit the wall from a position
While trying to determine why a page was taking 20s to load, I found
I'm trying to determine the asymptotic run-time of one of my algorithms, which uses
I am trying to determine when a specific function was added to one of
I'm trying to determine whether or not the user has voted on a certain
I'm trying to determine whether or not the user would prefer metric or imperial
Trying to determine if it is possible to bind the SelectedValue of a ComboBox

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.