GNOME Bugzilla – Bug 614009
PDFMod crashes when inserting a new (jpeg) image
Last modified: 2010-03-29 23:54:35 UTC
I had to make a 4 pages PDF adding 3 single page pdf file, and finally a jpeg (A4 format). The job went on rightly until the last page: every time I drug and drop a jpeg image after the last pdf page, the application crashes closing without any error message. The same result is obtained trying to append the new image page from the toolbar: menu File and click on "insert new page", I selected the jpeg file, click on the "Open" button, and PDFMod crashes, closing itself without any error message.
Thanks for taking the time to report this bug. Without a stack trace from the crash it's very hard to determine what caused it. Can you get us a stack trace? Please see http://live.gnome.org/GettingTraces for more information on how to do so. Thanks in advance!
I can reproduce it. Running pdfmod from the terminal, it prints out this trace when it dies: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The file is not a valid PDF document. at PdfSharp.Pdf.IO.PdfReader.Open (System.IO.Stream stream, System.String password, PdfDocumentOpenMode openmode, PdfSharp.Pdf.IO.PdfPasswordProvider passwordProvider) [0x00069] in /home/gabe/Projects/pdfmod/lib/PdfSharp/PdfSharp.Pdf.IO/PdfReader.cs:275 at PdfSharp.Pdf.IO.PdfReader.Open (System.String path, System.String password, PdfDocumentOpenMode openmode, PdfSharp.Pdf.IO.PdfPasswordProvider provider) [0x0000b] in /home/gabe/Projects/pdfmod/lib/PdfSharp/PdfSharp.Pdf.IO/PdfReader.cs:205 at PdfSharp.Pdf.IO.PdfReader.Open (System.String path, System.String password, PdfDocumentOpenMode openmode) [0x00000] in /home/gabe/Projects/pdfmod/lib/PdfSharp/PdfSharp.Pdf.IO/PdfReader.cs:193 at PdfMod.Pdf.Document.AddFromUri (System.Uri uri, Int32 to_index, System.Int32[] pages_to_import) [0x0001d] in /home/gabe/Projects/pdfmod/src/PdfMod/Pdf/Document.cs:288 at PdfMod.Pdf.Document.AddFromUri (System.Uri uri, Int32 to_index) [0x00000] in /home/gabe/Projects/pdfmod/src/PdfMod/Pdf/Document.cs:282 at PdfMod.Pdf.Document.AddFromUri (System.Uri uri) [0x00000] in /home/gabe/Projects/pdfmod/src/PdfMod/Pdf/Document.cs:277 at PdfMod.Gui.Actions.OnInsertFrom (System.Object o, System.EventArgs args) [0x000c8] in /home/gabe/Projects/pdfmod/src/PdfMod/Gui/Actions.cs:264
To be clear, we aren't going to support this, but we should certainly fix the crash, and tell the user that only PDF files can be inserted.
Fixed in master, look for it in 0.8.2 or 0.9. commit 86e6e8687ca64c19b371090dc09d327131495904 Author: Gabriel Burt <gabriel.burt@gmail.com> Date: Mon Mar 29 16:52:44 2010 Catch exceptions when inserting doc If the file isn't a PDF file, or PDFSharp is unable to load it, we now won't crash; instead we just warn the user. Fixes bgo#614009