PDFsharp & MigraDoc Foundation

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

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Apr 24, 2009 5:00 pm 
Offline

Joined: Fri Apr 24, 2009 3:23 pm
Posts: 1
Whenever I print a file to PDF using PDFCreator, then read the file with PDFSharp, the PdfDocument.Info object returns what appear to be incorrect values:
Code:
doc1.Info
(pairs=8)
    base {PdfSharp.Pdf.PdfDictionary}: (pairs=8)
    Author: "þÿ\0s\0r\0s\0m\0i\0t\0h"
    CreationDate: {4/24/2009 12:15:11 PM}
    Creator: "þÿ\0P\0D\0F\0C\0r\0e\0a\0t\0o\0r\0 \0V\0e\0r\0s\0i\0o\0n\0 \00\0.\09\0.\08"
    Keywords: ""
    Meta: {PdfSharp.Pdf.DictionaryMeta}
    ModificationDate: {4/24/2009 12:15:11 PM}
    Producer: "GPL Ghostscript 8.54"
    Subject: ""
    Title: "þÿ\0B\0o\0o\0k\01"


When i use iTextSharp to read the same file, i get the following:
Code:
doc2.Info
Count = 8
    ["CreationDate"]: "D:20090424121511-04'00'"
    ["Keywords"]: ""
    ["Author"]: "srsmith"
    ["Title"]: "Book1"
    ["Creator"]: "PDFCreator Version 0.9.8"
    ["Subject"]: ""
    ["ModDate"]: "D:20090424121511-04'00'"
    ["Producer"]: "GPL Ghostscript 8.54"


The code I used for the above (C# 3, .NET 3.5, PDFSharp 1.20):
Code:
string filename = @"C:\PDFs\Book1.pdf";
var doc1 = PdfSharp.Pdf.IO.PdfReader.Open(filename, PdfSharp.Pdf.IO.PdfDocumentOpenMode.Import);
var doc2 = new iTextSharp.text.pdf.PdfReader(filename);


I find PdfSharp easier to work with vs iTextSharp, however I need to be able to correctly read the Title from a PDF document. Is there some setting that I am missing when reading the PDF? If not, is there another method to obtaining the Title that returns the correct string?


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 411 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