PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Apr 23, 2024 6:08 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Wed Nov 20, 2013 4:14 am 
Offline

Joined: Tue Mar 19, 2013 2:14 pm
Posts: 10
I am using PdfSharp (installed with nuget) to try and make an extension to the awesome ApprovalTests.Net library.

I have two otherwise completely identical pdfs (I checked with winmerge) but they always have different trailer IDs.

This messes up ApprovalTests.

What goes into computing this field and can I have it be consistent?


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 20, 2013 9:33 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
PDF files contain date and time of their creation. Obviously this differs with every new run.

PDFsharp uses GUIDs for several items (including the trailer ID). These will be different with every new run.

I agree it would be nice to have a special mode for automatic testing that will create identical files. I will discuss this with Stefan.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 20, 2013 3:43 pm 
Offline

Joined: Tue Mar 19, 2013 2:14 pm
Posts: 10
Thanks Thomas,

In the meantime I am doing this. Maybe me butchering pdf files will provide motivation :)

Any input from you guys as far as edge cases this might not catch is appreciated.


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 20, 2013 4:14 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3096
Location: Cologne, Germany
togakangaroo wrote:
Maybe me butchering pdf files will provide motivation :)
I don't have a better idea for a quick solution. I had a similar idea.

My boss thinks about creating images from PDF pages and comparing those images (by creating a new image with the differences between the two source images for human analysis).
This will be a sophisticated solution, but not a quick solution.

As a short-term solution, keep on butchering.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 20, 2013 4:22 pm 
Offline

Joined: Tue Mar 19, 2013 2:14 pm
Posts: 10
Unfortunately creating images would limit the solution's application. ApprovalTests provides various reporters, you could reasonably use winmerge or a pdf comparer which would give far more useful info than images. Additionally, approved files with this framework are committed to source control - imagine even a simple 70 page pdf rasterized, imagine how large it would be.

But yes, in the meantime here we go.


Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 20, 2013 4:23 pm 
Offline

Joined: Tue Mar 19, 2013 2:14 pm
Posts: 10
Ideally, pdfsharp would have an option where you can provide your own method to generate an ID


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 19, 2014 2:02 am 
Offline

Joined: Fri Dec 19, 2014 1:46 am
Posts: 8
togakangaroo wrote:
I am using PdfSharp (installed with nuget) to try and make an extension to the awesome ApprovalTests.Net library.

I have two otherwise completely identical pdfs (I checked with winmerge) but they always have different trailer IDs.

This messes up ApprovalTests.

What goes into computing this field and can I have it be consistent?


Same question. Do you have any ideas for it now? Hope you can share more about your experience.

Best regards.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 194 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group