PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PdfDocument.Info returns incorrect values?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
gfreeman14094



Joined: 24 Apr 2009
Posts: 1

PostPosted: Fri Apr 24, 2009 5:00 pm    Post subject: PdfDocument.Info returns incorrect values? Reply with quote

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?
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com