PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Oct 22, 2017 2:50 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Apr 18, 2017 12:48 pm 
Offline

Joined: Tue Apr 18, 2017 12:28 pm
Posts: 2
Hi All,

Apologies complete newbie here. I'm trying to read the Author properties of a PDF file which contains a semicolon separated list, but I'm having trouble getting all values and just wondered if I'm doing something wrong? (more than likely :) )

Example:
PDF Author property contains: UserA; UserB; UserC; UserD;

Using c#:
pdfDocument pdfDoc = PdfReader.Open(path);
string pdfAuthor = pdfDoc.Info.Author;
pdfAuthor returns only UserA

Any help would be greatly appreciated.


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 18, 2017 1:30 pm 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2720
Location: Cologne, Germany
Hi!

It could be that the PDF file stores a short and a long author list at different locations and that you see the long list in Adobe Reader while PDFsharp retrieves the short version.

Just speculating as I don't have a PDF file to look at ...

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 18, 2017 2:46 pm 
Offline

Joined: Tue Apr 18, 2017 12:28 pm
Posts: 2
Hi,

Thanks for the quick response.

Unfortunately I cant send the original file due to its content, but i do know it was created by Acrobat Distiller 9.0.

Also, i cant seem to replicate the Author properties using BullZip as this creates the author list with a set of double quotes around it which my code reads straight away without issue.

Would you know the location of the short and long author list?

Thanks


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 19, 2017 7:56 am 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2720
Location: Cologne, Germany
swifty wrote:
Would you know the location of the short and long author list?
One field is part of the normal PDF structure. In your case it contains the short list. Adobe Reader shows quotes around this data if certain delimiters are contained in that field.

The other field is part of an XML file with meta data that is embedded in the PDF file (XMP). Adobe Reader does not add quotes when displaying this field. In your case it contains the long list.

At some stage those two fields got out of sync.

PDFsharp does not support XMP yet.

Open the PDF in WordPad or other editor and search for "UserA" to see where it occurs.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 10 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:  
cron
Powered by phpBB® Forum Software © phpBB Group