Once you get the PDF to bitmap you can compare the bitmaps
programmattically.  Get the difference of each channel of each pixel.  A bit
intensive.

Not only can you tell if there is a difference progammatically, but you can
also take the result of the pixel differences and produce a "difference"
bitmap.  If there is no difference it should be a pure black image.

-John


On 1/16/07, Jeremias Maerki <[EMAIL PROTECTED]> wrote:

What we do in FOP is calling GhostScript to convert the PDF to a bitmap
which can then be either put side-to-side with a reference or visually
"diffed" against a reference. This process isn't automated, yet.

See here:

http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/visual/

Of course, that doesn't test the non-visual features of PDF. But for
that you can use any PDF library and some JUnit test cases.

On 16.01.2007 17:15:15 Peter wrote:
> Fop fans,
>
>
>
> I am writing some regression tests for an application that uses fop to
> generate PDF files. I am trying to figure out how to compare the pdf
output
> with the master pdf files.
>
>
>
> Seems the pdf spec requires e.g. an ID in the trailer that is file
instance
> specific which makes (dumb) binary comparison with a master file
impossible.
>
>
>
> I guess I could check the fop input iso the fop output, but I'd rather
check
> the actual pdf if possible.
>
>
>
> How this is typically solved?
>
>
>
> Thanks,
>
>
>
> Peter
>



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
John Cavalieri

Reply via email to