I have committed the patch by Ulf Erikson that adds native PDF export (based on PS export code). It has many limitations but at least it's better than what we have now, because it does not require Ghostscript and, most importantly, handles transparency. Complex illustrations, such as this one:
http://www.inkscape.org/screenshots/gallery/inkscape-0.41-CVS-linux-davinci....
are shown quite faithfully by Adobe Acrobat after saving as PDF (though much slower than in Inkscape... and I thought our renderer is the slowest, heh).
Current limitations include: no text (check "Convert text to path"), no gradient on stroke, no clipping/masking/patterns, no eccentric elliptic gradients, no bitmaps.
I know we're probably going to have at least one SoC student working on PDF export, and I think it will make a perfect sense for that student to work on this existing code to improve it. However, even if the student will choose some other approach (e.g. using Cairo), it will be easy to replace this code. For now, however, it's the best we have, and I want this to be in 0.44.
On Fri, 2006-05-19 at 00:57 -0300, bulia byak wrote:
I have committed the patch by Ulf Erikson that adds native PDF export (based on PS export code). It has many limitations but at least it's better than what we have now, because it does not require Ghostscript and, most importantly, handles transparency. Complex illustrations, such as this one:
I've tried to use this in the lastest SVN. I get an "Inkscape encountered an internal error and will close now." message. Running under gdb I get:
*** glibc detected *** /home/tavmjong/sandbox/bin/inkscape: munmap_chunk(): invalid pointer: 0x0b9fa47c ***
Output of 'where':
#0 0x0014e402 in __kernel_vsyscall () #1 0x00194069 in raise () from /lib/libc.so.6 #2 0x00195671 in abort () from /lib/libc.so.6 #3 0x001c8a4b in __libc_message () from /lib/libc.so.6 #4 0x001d34f0 in free () from /lib/libc.so.6 #5 0x07f21fe1 in operator delete () from /usr/lib/libstdc++.so.6 #6 0x083768d5 in PdfFile::end_page (this=0xba1f1f8, page=0xba243c0) at extension/internal/pdf-mini.h:315 #7 0x083771f6 in Inkscape::Extension::Internal::PrintPDF::finish (this=0xa037130, mod=0xa037878) at extension/internal/pdf.cpp:428 #8 0x08366b38 in Inkscape::Extension::Print::finish (this=0xa037878) at extension/print.cpp:60 #9 0x0837b30a in Inkscape::Extension::Internal::PdfOutput::save (this=0xa037618, mod=0xa036910, doc=0xa088f00, uri=0xb9e2018 "/home/tavmjong/Desktop/test.pdf") at extension/internal/pdf-out.cpp:68 #10 0x08365214 in Inkscape::Extension::Output::save (this=0xa036910, doc=0xa088f00, uri=0xb9e2018 "/home/tavmjong/Desktop/test.pdf") at extension/output.cpp:232 #11 0x083638fd in Inkscape::Extension::save (key=0xa036910, doc=0xa088f00, filename=0xb87f4e0 "/home/tavmjong/Desktop/test.pdf", setextension=true, check_overwrite=true, official=true) at extension/system.cpp:251 #12 0x080794ea in file_save (doc=0xa088f00, uri=0xb87f4e0 "/home/tavmjong/Desktop/test.pdf", key=0xa036910, saveas=true) at file.cpp:548
My gdb skills are rather rusty but if more info is needed I can try to provide it.
Tav
Please file a bug with sample file, steps, all your libs etc.
From this:
*** glibc detected *** /home/tavmjong/sandbox/bin/inkscape: munmap_chunk(): invalid pointer: 0x0b9fa47c ***
it looks very much like compiler version incompatibility, though I'm not sure why it's triggered by PDF export. Try to recompile all the C++ libs with the current compiler.
Tavmjong Bah wrote:
On Fri, 2006-05-19 at 00:57 -0300, bulia byak wrote:
I have committed the patch by Ulf Erikson that adds native PDF export (based on PS export code). It has many limitations but at least it's better than what we have now, because it does not require Ghostscript and, most importantly, handles transparency. Complex illustrations, such as this one:
I've tried to use this in the lastest SVN. I get an "Inkscape encountered an internal error and will close now." message. Running under gdb I get:
*** glibc detected *** /home/tavmjong/sandbox/bin/inkscape: munmap_chunk(): invalid pointer: 0x0b9fa47c ***
Output of 'where':
#6 0x083768d5 in PdfFile::end_page (this=0xba1f1f8, page=0xba243c0) at extension/internal/pdf-mini.h:315
Line 315 of pdf-mini.h reads "delete resources;", but since 'resources' was allocated with "new PdfXref[11]();" it must be "delete[] resources;". Such a fault is likely to cause memory corruption and/or a crash. Can someone able to reproduce this crash please try the fix and report back?
Quoting Ulf Erikson <ulferikson@...400...>:
Tavmjong Bah wrote:
On Fri, 2006-05-19 at 00:57 -0300, bulia byak wrote:
I have committed the patch by Ulf Erikson that adds native PDF export (based on PS export code). It has many limitations but at least it's better than what we have now, because it does not require Ghostscript and, most importantly, handles transparency. Complex illustrations, such as this one:
I've tried to use this in the lastest SVN. I get an "Inkscape encountered an internal error and will close now." message. Running under gdb I get:
*** glibc detected *** /home/tavmjong/sandbox/bin/inkscape: munmap_chunk(): invalid pointer: 0x0b9fa47c ***
Output of 'where':
#6 0x083768d5 in PdfFile::end_page (this=0xba1f1f8, page=0xba243c0) at extension/internal/pdf-mini.h:315
Line 315 of pdf-mini.h reads "delete resources;", but since 'resources' was allocated with "new PdfXref[11]();" it must be "delete[] resources;". Such a fault is likely to cause memory corruption and/or a crash. Can someone able to reproduce this crash please try the fix and report back?
That fixed the crash for me! Thanks!
Tav
On Jun 1, 2006, at 1:15 PM, Ulf Erikson wrote:
Line 315 of pdf-mini.h reads "delete resources;", but since 'resources' was allocated with "new PdfXref[11]();" it must be "delete[] resources;". Such a fault is likely to cause memory corruption and/ or a crash. Can someone able to reproduce this crash please try the fix and report back?
I reproduced a problem (but not actual crash) on OS X, applied this fix, and verified that it corrected things.
bulia byak wrote:
I have committed the patch by Ulf Erikson that adds native PDF export (based on PS export code). It has many limitations but at least it's better than what we have now, because it does not require Ghostscript and, most importantly, handles transparency.
I just tried on win32 and am getting the error:
'ps2pdf.bat' is not recognized as an internal or external command, operable program or batch file.
-Josh
On 5/19/06, Joshua A. Andler <joshua@...533...> wrote:
I just tried on win32 and am getting the error:
'ps2pdf.bat' is not recognized as an internal or external command, operable program or batch file.
That's the old one. I guess I need to delete it. (Or you're not running the latest.) Here on Linux, the new internal extension somehow shadowed the old one, but maybe it's only here.
It would be best if Ted could have a look at this...
bulia byak wrote:
On 5/19/06, Joshua A. Andler <joshua@...533...> wrote:
I just tried on win32 and am getting the error:
'ps2pdf.bat' is not recognized as an internal or external command, operable program or batch file.
That's the old one. I guess I need to delete it. (Or you're not running the latest.) Here on Linux, the new internal extension somehow shadowed the old one, but maybe it's only here.
Thanks for pointing that out about it being the old one. I feel like an idiot... I normally just overwrite my builds every day. I deleted the dir and extracted it "fresh" and everything is golden. Thank you!
-Josh
participants (7)
-
unknown@example.com
-
Andy Fitzsimon
-
bulia byak
-
Jon A. Cruz
-
Joshua A. Andler
-
Tavmjong Bah
-
Ulf Erikson