You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Steffanina, Jeff" <Je...@marriott.com> on 2008/09/23 18:46:37 UTC
Validate the integrity of the PDF
FOP-0.95
Redhat Linux
All output looks great.
Situation:
IF the XML file contains a bug, a PDF is still created. Therefore, I
end up with a badly formed PDF on the disk. I then pass this bad file
to the spooler and the PDF file hangs the spooler. Due to the multiple
levels of system calls I am making in the application, I am unable to
trap the error (in this case, an fop ValidationException error).
Question:
When woking in the Korn shell, is there a simple way to test/determine
that the PDF file generated is properly formed and functional?
Thanks.
Jeff
Re: Validate the integrity of the PDF
Posted by "kindaian@gmail.com" <ki...@gmail.com>.
The first thing that occurred to me was some sort of pdf text extract...
If it fails due to badly formed pdf on the previous step, then probably
its because the file is corrupt.
Check for instance:
http://www.a-pdf.com/text/
Prolly there are tools like this for linux/korn shell compatible...
H2HH
:)
Steffanina, Jeff wrote:
>
> FOP-0.95
> Redhat Linux
> All output looks great.
>
> Situation:
> IF the XML file contains a bug, a PDF is still created. Therefore, I
> end up with a badly formed PDF on the disk. I then pass this bad file
> to the spooler and the PDF file hangs the spooler. Due to the
> multiple levels of system calls I am making in the application, I am
> unable to trap the error (in this case, an fop ValidationException error).
>
> Question:
> When woking in the Korn shell, is there a simple way to test/determine
> that the PDF file generated is properly formed and functional?
>
>
>
> Thanks.
>
>
> */Jeff/*
>
Re: Validate the integrity of the PDF
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
If there's an exception the FOP command-line interface deletes a PDF
that has not been fully written. The application also sets an error code
in that case that can be inspected by a shell script.
Am I reading you correctly that you have your own application and you're
not using the command-line interface? In that case, using a tool to
validate the PDF is IMO the wrong approach. Better get your exception
handling right and catch the problem earlier rather than spend a lot of
CPU cycles to do forensics on the PDF.
On 23.09.2008 18:46:37 Steffanina, Jeff wrote:
>
> FOP-0.95
> Redhat Linux
> All output looks great.
>
> Situation:
> IF the XML file contains a bug, a PDF is still created. Therefore, I
> end up with a badly formed PDF on the disk. I then pass this bad file
> to the spooler and the PDF file hangs the spooler. Due to the multiple
> levels of system calls I am making in the application, I am unable to
> trap the error (in this case, an fop ValidationException error).
>
> Question:
> When woking in the Korn shell, is there a simple way to test/determine
> that the PDF file generated is properly formed and functional?
>
>
>
> Thanks.
>
>
> Jeff
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org