xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rachel C. Rusinski" <Rusinski_Rache...@cat.com>
Subject Re: FOP PDF content height calculations
Date Wed, 02 Nov 2005 16:46:36 GMT

The number of questions is not finite.  Any question group can have a
number of different questions.  And each survey will have varying numbers
of question groups based on the number of inches of each question group.
The maximum number of pages in a survey is 4 pages so the process is such
that it will run through question groups that a person qualifies for and
keep adding question groups to the survey until the height in inches
reaches the 4 pages or until the person doesn't qualify for any additional
question groups (whichever comes first).  So, each question group must be
measured upon the save action.  The administrative users of the application
have the ability to alter a question group as needed so the possibility
exists for the height to change and therefore cannot be manually inserted
into the database.

I need FOP to render a dummy PDF upon save of a question group and return
to me the exact height in inches of that question group.

Thank You,
Rachel Rusinski
Human Resources Systems Development
Global IT Solutions - Global Customer Solutions
Ext. 4-6571

             Glen Mazza                                                    
             10/31/2005 05:33                                           To 
             PM                        fop-users@xmlgraphics.apache.org    
             Please respond to                                             
                                       Re: FOP PDF content height          

Caterpillar: Confidential Green                 Retain Until: 11/30/2005
                                                Retention Category:  G90 -

[Happy Halloween everyone!]

Ben Geyer wrote:

> At the risk of annoying the fine people on this list, I'll try to
> restate my question with the original message in context:
> Since Rachel's limitation seems to be the number of pages, would another
> approach be to continue processing questions until you reached the end
> of the fourth page?
> Is there any capability in FOP that would allow for
> listening for this event and then tracking which question was the last
> rendered?

I don't think so.  That would imply that FOP would have knowledge of the
semantics of the text--i.e., what a question is and what delimits it.

> This seems like it could be a more simplistic approach to the
> problem than pulling the latest off of the trunk.
> Opinions?

Thankfully, since the number of possible questions is finite, it may be
simplest for Rachel to just print them all out, measure them each
manually, and use that metric in her database, instead of what she is
calculating with the MyRenderer subclass.

I have had problems with FOP 0.20.5 too in this regard, for some reason
the dimensions of the margins I chose have never really been that
accurate for me when printed out.


> Thanks,
> Ben Geyer
> Hello,
> I have an application which generates surveys and converts the contents
> a PDF via FOP for printing.  There is a maximum allowable number of pages
> for any given survey.  Since each survey generated is dynamic and unique
> based on outside information it is necessary for me to calculate the
> number of inches that each potential question may consume on the
> PDF file.  The number of inches for each potential question is stored on
> the database with the question content.
> When the question is saved, I need to render a PDF in order to determine
> the content height in inches.  We have started off by extending the
> PDFRenderer class and adding several methods.  The application basically
> sends the FO file for conversion and the renderer class ("MyRenderer.java
> ")
> provides a method to calculate height in inches.
> I am encountering a problem with the calculation - when the final PDF is
> printed the actual number of inches (when measured manually) is somewhat
> smaller than what the application gives as the content height in inches.
> am having trouble figuring out what is actually happening here in the
> PDFRenderer.  The renderWordArea method seems to be called many times
> though there should only be a single word Area.
> In the example below we are printing the survey on a
> 8.5 x 14 (Legal) size
> paper.  The question itself manually measures out to be approximately 6.9
> or 7 inches in height with the margins specified in the FO file.
> the calculated height in inches is 6.88 inches.  When the size of the
> question is increased the accuracy gets worse.


To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

View raw message