On 27.01.2010 16:11:52 Hu, Zemin wrote:
> Thanks for suggestions. Please understand the data definitely stays the same 
> in between clicks.
> Couple of concerns:
> 1. I did two steps PDF generation when I was at concept proof stage, I found 
> the intermediate fo file was huge and not useful, another reason is that it 
> impairs performance. So I abandoned doing that. I am not sure this helps due 
> to the nature of the randomness of the error.

But keeping it at two steps for now would allow you to determine if the
problem is on the XSLT side or the FOP side. It sounds a lot like a
multi-threading problem.

> 2. If I turn off validation, is it possible to cause more bad PDF 
> generations? I am just speculating.
> 
> Thanks.
> 
> Zemin
> 
> -----Original Message-----
> From: Pascal Sancho [mailto:[email protected]] 
> Sent: Monday, January 25, 2010 10:47 AM
> To: [email protected]
> Subject: Re: Create damaged PDF file
> 
> Hi,
> 
> Hu, Zemin a écrit :
> > I am using XML+XSLT combination as you indicated, but the error message is 
> > NOT consistent, it may disappear on next run, so I don't know how to debug 
> > my template to be clean since it is clean most of the time.
> >   
> If the message disappears between 2 runs, that means that something has
> changed in the XML source (or less probably in the XSLT).
> 
> A good practice here is to separate the full transformation into 2 stages:
> 1/ XSLT transformation (invoking Xalan directly, for example) and get
> the XSL-FO file
> 2/ PDF generation, invoking FOP with the produced XSL-FO.
> 
> Benefits:
>  - you can inspect (and reformat for better readability) the XSL-FO file
>  - FOP can know the exact location where the error occurs, and send it
> to you in the error message.
>  - FOP list can help you more efficiently.
> 
> > Thanks for pointing out to me the configuration option, I was going to 
> > test, but after reading document from your URL, I found it won't help in 
> > this case because the default value for "strict-configuration" option is 
> > "false" already.
> >   
> My bad, this option is for configuation file.
> What I wanted to point to was the [strict-validation] option, witch
> default to true.
> 
> > Zemin
> >
> > -----Original Message-----
> > Hi,
> > as the error message said, you have an empty fo:table-row in the
> > resulting XSL-FO file.
> > I guess you use a XML + XSLT couple to get such file, therefore you
> > should debug your XSLT to produce a clean, valid XSL-FO code.
> >
> > An alternative is to configure FOP to be more "laxist". See
> > "strict-configuration" option in FOP configuration [1].
> >
> > [1]
> > http://xmlgraphics.apache.org/fop/0.95/configuration.html#general-elements
> >
> > HTH,
> > Pascal
> >
> > Hu, Zemin a écrit :
> >   
> >> I am new here and have a question. 
> >>
> >> I am creating PDF on the fly for a web application. A PDF file is supposed 
> >> to open when user clicks on a link. Occasionally the created PDF file 
> >> cannot be opened and the error message says: "File is damaged and could 
> >> not be repaired".
> >>
> >> When I read log file, I can find error message:
> >> SystemErr     R (Location of error 
> >> unknown)org.apache.fop.fo.ValidationException: Error(Unknown location): 
> >> fo:table-row is missing child elements. Required Content Model: 
> >> (table-cell+)
> >>
> >> The weird thing is that this error only happens at first time or first few 
> >> times, then the PDF file generation goes fine. Then if user browses other 
> >> pages and comes back, this can happen again. This error is not consistent, 
> >> sometimes everything is just fine. This is really frustrating and hard to 
> >> debug. 
> >>
> >> This never happened in my unit test and local environment. So I am 
> >> thinking it might be the cache issue or web server configuration issue. 
> >> But I have no clue. This is tough one.
> >>
> >> Any suggestions or solutions?
> >>
> >> Thanks.
> >>
> >> Zemin
> >>     
> Pascal
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 
> ----------------------------------------------------------------------
> This message and any attachments are intended only for the use of the 
> addressee and may contain information that is privileged and confidential. If 
> the reader of the message is not the intended recipient or an authorized 
> representative of the intended recipient, you are hereby notified that any 
> dissemination of this communication is strictly prohibited. If you have 
> received this communication in error, notify the sender immediately by return 
> email and delete the message and any attachments from your system.




Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to