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 

Exception when opening PDF file

 
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 -> Bug Reports - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
BoresXP



Joined: 13 Aug 2007
Posts: 4
Location: Moscow

PostPosted: Mon Aug 13, 2007 9:20 am    Post subject: Exception when opening PDF file Reply with quote

When I try to open a file (I can send you this file by mail) System.AgrumentException is thrown: "key must be of type System.String". When I'm opening the same file in PDFSharp Document Explorer I see the same error.

Stack trace:
in PdfSharp.Pdf.PdfDictionary.DictionaryElements.System.Collections.IDictionary.Add(Object key, Object value) in PdfSharp\\PdfSharp.Pdf\\PdfDictionary.cs:line 1043
in PdfSharp.Pdf.PdfDictionary.DictionaryElements.Add(Object key, PdfItem value) in PdfSharp\\PdfSharp.Pdf\\PdfDictionary.cs:line 1062
in PdfSharp.Pdf.PdfPage.InheritValues(PdfDictionary page, InheritedValues values) in PdfSharp\\PdfSharp.Pdf\\PdfPage.cs:line 515
in PdfSharp.Pdf.PdfPages.GetKids(PdfReference iref, InheritedValues values, PdfDictionary parent) in PdfSharp\\PdfSharp.Pdf\\PdfPages.cs:line 350
in PdfSharp.Pdf.PdfPages.GetKids(PdfReference iref, InheritedValues values, PdfDictionary parent) in PdfSharp\\PdfSharp.Pdf\\PdfPages.cs:line 360
in PdfSharp.Pdf.PdfPages.FlattenPageTree() in PdfSharp\\PdfSharp.Pdf\\PdfPages.cs:line 315
in PdfSharp.Pdf.Advanced.PdfCatalog.get_Pages() in PdfSharp\\PdfSharp.Pdf.Advanced\\PdfCatalog.cs:line 102
in PdfSharp.Pdf.PdfDocument.get_Pages() in PdfSharp\\PdfSharp.Pdf\\PdfDocument.cs:line 590
Back to top
View user's profile Send private message Visit poster's website
BoresXP



Joined: 13 Aug 2007
Posts: 4
Location: Moscow

PostPosted: Tue Aug 14, 2007 2:34 pm    Post subject: Reply with quote

Exception is rised in PdfSharp.Pdf.PdfDictionary.DictionaryElements, in IDictionary.Add implementation. key parameter is checked to be a string, but it is of type PdfSharp.Pdf.PdfName.

This code is called from DpfSharp.Pdf.PdfPage.InheritValues.
Back to top
View user's profile Send private message Visit poster's website
BoresXP



Joined: 13 Aug 2007
Posts: 4
Location: Moscow

PostPosted: Tue Aug 14, 2007 4:34 pm    Post subject: Reply with quote

OK, I found where the error is:

File: PdfPage.cs
Line: 515

Is:
Code:
resources.Elements.Add(name, item);

Must be:
Code:
resources.Elements.Add(name.Value, item);


Please, correct this error!
Back to top
View user's profile Send private message Visit poster's website
Stefan Lange



Joined: 12 Oct 2006
Posts: 47
Location: Cologne, Germany

PostPosted: Sun Sep 02, 2007 5:56 pm    Post subject: Reply with quote

Youre are right.
I fixed this in PdfDictionary.PdfDictionaryElements.IDictionary.Add:
Code:
if (key is PdfName)
  key = (key as PdfName).Value;
[/code]
Back to top
View user's profile Send private message Send e-mail
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 -> Bug Reports - 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