Welcome Guest Search | Active Topics | Sign In | Register

UnitTesting \ Automation with EO Options
Aviram
Posted: Sunday, May 22, 2016 9:00:36 AM
Rank: Newbie
Groups: Member

Joined: 5/22/2016
Posts: 6
Hi,

Can I create a unit test that check if my code that create the PDF report didn't broke?
I would like to create a "good" pdf report that I created using the EO component that I manually verified him.
And create in the scenario the same PDF - from the same HTML files and compare both PDF

I tried to do so, but found out the the binary is different.

Is there a way to verify that two PDF generated from the same input or visually the same?
without 3rd party software for visual compare?

Thanks
eo_support
Posted: Monday, May 23, 2016 11:35:37 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

It is not possible to compare PDF files directly with our product. What you can do is to set HtmlToPdf.Options.GeneratePageImages to true and then compare the similarity of the page images. Comparing images is a common task for test automation. MS has one implementation here:

https://msdn.microsoft.com/en-us/library/hh157587.aspx

You can also find a number of other implementation online.

Thanks!
Aviram
Posted: Tuesday, May 24, 2016 10:19:59 AM
Rank: Newbie
Groups: Member

Joined: 5/22/2016
Posts: 6
Hi,
Thanks for the quick reply.

I tried using the "HtmlToPdf.Options.GeneratePageImages" and did managed to get PNG's and compare them.
But...

I noticed that the PNG's are different from the final PDF page.
For example,
I adding header and footer for each page before I export the Images using:

AcmRender render = new AcmRender(page, 0, new AcmPageLayout(new AcmPadding(0.5f, 0, 0.5f, 0)));
render.Render(headerTable, footerTable);

I do get the footer and header in the PDF file but the Images are exported without it.

Is it a defect?
Is there an options the export to PNG the final PDF pages?

Thanks
eo_support
Posted: Tuesday, May 24, 2016 12:31:41 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

Whatever you added after the conversion will not be reflected through the page images. The page images is an output of the HTML to PDF converter, what you rendered through AcmRender is completely separate so it won't go into page images. Currently there is no way to render the final PDF as images with our product, even though we may add this feature in the future.

Thanks!
Aviram
Posted: Wednesday, May 25, 2016 2:48:30 AM
Rank: Newbie
Groups: Member

Joined: 5/22/2016
Posts: 6
OK,
Got it,

I'll post this request in the feature request tab.
This ability is highly important for us.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.