PDFsharp & MigraDoc Foundation

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

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon May 28, 2007 9:33 pm 
Offline

Joined: Mon May 28, 2007 9:02 pm
Posts: 1
Location: Australia
I have added a simple 'concatenate files' operation to an application, based on the code in the pdfsharp samples. Code appears to be working fine for many pdf docs.

However when attempting to open some dpf files [using PdfReader.Open(file, PdfDocumentOpenMode.Import)] a PdfSharp.Pdf.IO.PdfReaderException is thrown by the pdfsharp code.

Acrobat reader 8 opens the files without any problems.

As a test I copied some of the problem pdf files to the folder used by the concatenate documents pdfsharp sample & ran the sample. It stopped with the same exception. The error & stac trace from the sample app are included below. I did not change the saple source.k

Does anyone know about this error?
can anyone give me some clues as to how to go about fixing it?
I am new to pdf files, but am happy to work on a fix for the library (if required).

Thanks in advance
Kon Tantos

Error & stack trace from vs2005.

PdfSharp.Pdf.IO.PdfReaderException was unhandled
Message="UNEXPECTED ERROR while formatting message: System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure \"PdfSharp.Resources.Messages.resources\" was correctly embedded or linked into assembly \"PdfSharp\" at compile time, or that all the satellite assemblies required are loadable and fully signed.\r\n at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)\r\n at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)\r\n at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)\r\n at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)\r\n at System.Resources.ResourceManager.GetString(String name)\r\n at PdfSharp.PSSR.GetString(PSMsgID id) in D:\\_Development\\Research\\PDFSharp-0.9.653+MigraDocLite-1.2.1930\\PDFsharp\\PdfSharp\\PdfSharp\\PSSR.cs:line 108\r\n at PdfSharp.PSSR.Format(PSMsgID id, Object[] args) in D:\\_Development\\Research\\PDFSharp-0.9.653+MigraDocLite-1.2.1930\\PDFsharp\\PdfSharp\\PdfSharp\\PSSR.cs:line 72"
Source="PdfSharp"
StackTrace:
at PdfSharp.Pdf.IO.Parser.ReadSymbol(Symbol symbol) in D:\_Development\Research\PDFSharp-0.9.653+MigraDocLite-1.2.1930\PDFsharp\PdfSharp\PdfSharp.Pdf.IO\Parser.cs:line 538
at PdfSharp.Pdf.IO.Parser.ReadTrailer() in D:\_Development\Research\PDFSharp-0.9.653+MigraDocLite-1.2.1930\PDFsharp\PdfSharp\PdfSharp.Pdf.IO\Parser.cs:line 708
at PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider) in D:\_Development\Research\PDFSharp-0.9.653+MigraDocLite-1.2.1930\PDFsharp\PdfSharp\PdfSharp.Pdf.IO\PdfReader.cs:line 275
at PdfSharp.Pdf.IO.PdfReader.Open(String path, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider provider) in D:\_Development\Research\PDFSharp-0.9.653+MigraDocLite-1.2.1930\PDFsharp\PdfSharp\PdfSharp.Pdf.IO\PdfReader.cs:line 200
at PdfSharp.Pdf.IO.PdfReader.Open(String path, PdfDocumentOpenMode openmode) in D:\_Development\Research\PDFSharp-0.9.653+MigraDocLite-1.2.1930\PDFsharp\PdfSharp\PdfSharp.Pdf.IO\PdfReader.cs:line 172
at ConcatenateDocuments.Program.Variant1() in D:\_Development\Research\PDFSharp-0.9.653+MigraDocLite-1.2.1930\PDFsharp\Samples C#\ConcatenateDocuments\Program.cs:line 87
at ConcatenateDocuments.Program.Main(String[] args) in D:\_Development\Research\PDFSharp-0.9.653+MigraDocLite-1.2.1930\PDFsharp\Samples C#\ConcatenateDocuments\Program.cs:line 49
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jun 07, 2007 8:50 am 
Offline
empira Employee
User avatar

Joined: Thu Oct 12, 2006 10:07 pm
Posts: 49
Location: Cologne, Germany
Hi,

the UNEXPECTED ERROR while formatting message... comes because a satellite assembly with the errors messages was not found. This may be a build error.

The actual error is in PdfSharp.Pdf.IO.Parser.ReadSymbol called from PdfSharp.Pdf.IO.Parser.ReadTrailer. I cannot guess what happens here. Please send me the PDF (using the e-mail address published in the source code) and I will take a look at it.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 30, 2008 2:31 am 
Offline

Joined: Mon Apr 28, 2008 10:39 pm
Posts: 1
Hi Stefan,

Did you ever get to the bottom of this problem? I am getting the same error.


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 27, 2016 8:02 pm 
Offline

Joined: Tue Sep 27, 2016 7:55 pm
Posts: 1
I'm getting a similar error with 1.50 beta3. In my case, the fault that starts the chain is that I'm trying to open a secured PDF without providing a password or anything. That generates a PdfReaderException. The problem is that the PdfReaderException is trying to use the PdfSharp-gdi DLL's Resources\Messages.restext resources... only they don't exist. And it seems as though the reason they don't exist is pretty simple - the Build Action for both the Messages.restext and the Messages.de.restext is set to "None" in the source code I have. I changed that to "Embedded Resource" and rebuilt and tried again and got the PdfReaderException as expected, which I can handle cleanly.

Is there a process by which I can submit my suggested change? In this particular case it's probably not worth it :wink: but if I find more things in the future that I could help address, I'd prefer to feed fixes back rather than having to maintain my own version of the codebase... :)


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 27, 2016 9:50 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 913
Location: CCAA
Hi!
canuckotter wrote:
Is there a process by which I can submit my suggested change?
Bug fixes posted on the forum will be evaluated and will get into the codebase, so posting here is a good way.

The resources bug was fixed some time ago.
A new release is overdue but I cannot give any ETA.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
 Post subject: Re:
PostPosted: Tue Oct 04, 2016 3:35 pm 
Offline

Joined: Tue Aug 02, 2016 9:56 am
Posts: 40
Location: Amsterdam, The Netherlands
Stefan Lange wrote:
The actual error is in PdfSharp.Pdf.IO.Parser.ReadSymbol called from PdfSharp.Pdf.IO.Parser.ReadTrailer. I cannot guess what happens here.


If the issue of the original poster from 2007 has not been fixed yet in 1.50_beta3, it may be worth trying some of the fixes I recently posted on the "Bug fixes" forum, for example this one: viewtopic.php?f=3&t=3451 .

_________________
Gerben Vos
Developer


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

All times are UTC


Who is online

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