
Like others I have been getting intermittent and unpredictable (though quite often) crashes when opening or importing pdf files. I found where it crashes but I have no idea why. So I just commented out one line, which seems to have fixed it for me - likely at the expense of a memory leak. Please test if this fixes the crashes for you.
This is the line 711 in src/extension/internal/pdfinput/pdf-input.cpp:
//delete pdf_doc;
I'm at a loss when it comes to such mysterious crashes - there's definitely no double delete here and nothing obviously fishy. So if anyone can discover the true reason please share it with us.

This seemed to mostly work. It opened every test pdf in the poppler test suite except the password protected one, and they seemed to render mostly fine (apart from known problems, like multiple pages and attachments).
A couple of quirks: every time I cancelled the import screen (on different files) it crashed. Also, when opening a pdf from the command line, I got no preview, though it was available when opening from a running instance of Inkscape.
Is there a solution for multi-page pdfs, even before considering multi-page svgs? Why not import each page into a separate layer labeled by page number?
JF
bulia byak wrote:
Like others I have been getting intermittent and unpredictable (though quite often) crashes when opening or importing pdf files. I found where it crashes but I have no idea why. So I just commented out one line, which seems to have fixed it for me - likely at the expense of a memory leak. Please test if this fixes the crashes for you.
This is the line 711 in src/extension/internal/pdfinput/pdf-input.cpp:
//delete pdf_doc;
I'm at a loss when it comes to such mysterious crashes - there's definitely no double delete here and nothing obviously fishy. So if anyone can discover the true reason please share it with us.

On Jan 8, 2008 11:54 PM, Joshua Facemyer / Impressus Art > A couple of quirks: every time I cancelled the import screen (on
different files) it crashed.
That was yet another delete pdf_doc, now I removed it too and it no longer crashes on cancel
Also, when opening a pdf from the command line, I got no preview, though it was available when opening from a running instance of Inkscape.
I confirm that - Miklos, can you look into that please?
Or, do we need the import options dialog at all when opening from command line? Maybe just open the first page with all the default options? I think this would be more useful for automated scenarios.
Is there a solution for multi-page pdfs, even before considering multi-page svgs? Why not import each page into a separate layer labeled by page number?
I think importing one page that you can select is good enough at this time. When we support multipage SVG, we can revisit that to import all pages of a multipage PDF.

bulia byak wrote:
On Jan 8, 2008 11:54 PM, Joshua Facemyer / Impressus Art > A couple of quirks: every time I cancelled the import screen (on
different files) it crashed.
That was yet another delete pdf_doc, now I removed it too and it no longer crashes on cancel
Thanks! Is that revision in svn now?
Also, when opening a pdf from the command line, I got no preview, though it was available when opening from a running instance of Inkscape.
I confirm that - Miklos, can you look into that please?
Or, do we need the import options dialog at all when opening from command line? Maybe just open the first page with all the default options? I think this would be more useful for automated scenarios.
That actually sounds better. I was getting kind of annoyed by the dialog opening from command line usage.
Is there a solution for multi-page pdfs, even before considering multi-page svgs? Why not import each page into a separate layer labeled by page number?
I think importing one page that you can select is good enough at this time. When we support multipage SVG, we can revisit that to import all pages of a multipage PDF.
Right-o, I just wasn't paying attention to the dialog after testing 64,387 pdfs :)
Thanks.
JF

Tue, 8 Jan 2008 03:17:47 -0400 "bulia byak" <buliabyak@...400...> kirjoitti:
Like others I have been getting intermittent and unpredictable (though quite often) crashes when opening or importing pdf files. I found where it crashes but I have no idea why. So I just commented out one line, which seems to have fixed it for me - likely at the expense of a memory leak. Please test if this fixes the crashes for you.
This is the line 711 in src/extension/internal/pdfinput/pdf-input.cpp:
//delete pdf_doc;
I'm at a loss when it comes to such mysterious crashes - there's definitely no double delete here and nothing obviously fishy. So if anyone can discover the true reason please share it with us.
I looked into this, and I belive I found the problem.
PDFDoc constructor takes a pointer to GooString containing the filename. PDFDoc object stores this pointer, and will try to delete it when destructed. Because Inkscape deleted that string too, it crashed.
Fix committed in SVN, try if it works.

On Jan 9, 2008 7:03 PM, Niko Kiirala <niko@...1267...> wrote:
I looked into this, and I belive I found the problem.
PDFDoc constructor takes a pointer to GooString containing the filename. PDFDoc object stores this pointer, and will try to delete it when destructed. Because Inkscape deleted that string too, it crashed.
Fix committed in SVN, try if it works.
Wow, thanks a lot, works perfectly now! Even the no-preview-from-commandline bug is fixed now.
participants (3)
-
bulia byak
-
Joshua Facemyer / Impressus Art
-
Niko Kiirala