PS and PDF: Print/Save As
Hi,
I have been trying to understand Inkscape's PS and PDF output with v0.46. It is very confusing so I thought I would summarize what I have found in a table. I tested the various ways to get PS and PDF output with: http://tavmjong.free.fr/INKSCAPE/MANUAL/images/SVG_TESTS/svg_test.svg .
Save As Print
Cairo Vector Raster#
PS PS% PDF PS PDF PS PDF Patterns No Wrong No Wrong Wrong Yes Yes Clipping No Wrong No Wrong Wrong Yes Yes Masking No No No No No Yes Yes Transparency No Yes Yes* Yes Yes Yes Yes Dashed Lines Yes Wrong Yes Wrong Wrong Yes Yes Gradient on Stroke No Yes Yes* Yes Yes Yes Yes
# Only at 72 dpi regardless of DPI setting. % Crashes when run from window manager but not command line. * Displays OK in Acroread, not with Evince 0.8.2.
The "Save As" and "Print" PDF use two different Cairo routines. What is the history of this? It seems to be a bit of a waste of effort.
Tav
Let's try this again with better (hopefully) table formatting...
Hi,
I have been trying to understand Inkscape's PS and PDF output with v0.46. It is very confusing so I thought I would summarize what I have found in a table. I tested the various ways to get PS and PDF output with: http://tavmjong.free.fr/INKSCAPE/MANUAL/images/SVG_TESTS/svg_test.svg .
| Save As | Print | | Cairo | Vector | Raster# | PS | PS% PDF | PS PDF | PS PDF ------------------------------------------------------------------------ Patterns | No | Wrong No | Wrong Wrong | Yes Yes Clipping | No | Wrong No | Wrong Wrong | Yes Yes Masking | No | No No | No No | Yes Yes Transparency | No | Yes Yes* | Yes Yes | Yes Yes Dashed Lines | Yes | Wrong Yes | Wrong Wrong | Yes Yes Grad/Stroke | No | Yes Yes* | Yes Yes | Yes Yes
% Crashes when run from window manager but not command line. # Only at 72 dpi regardless of DPI setting. * Displays in Acroread OK, not with Evince 0.8.2.
The "Save As" and "Print" PDF use two different Cairo routines. What is the history of this? It seems to be a bit of a waste of effort.
Tav
On Tue, 2008-06-17 at 14:41 +0200, Tavmjong Bah wrote:
The "Save As" and "Print" PDF use two different Cairo routines. What is the history of this? It seems to be a bit of a waste of effort.
At the core they should be the same, IIRC. What we were doing with the printing was trying to go in and grab the core of the Cairo stuff out of the save and repurpose it to use GTK Print. I can't say that we didn't screw up at that, but that was the goal. I'm surprised there is differences between the two, could it have something to do with what GTK + is doing with the CairoContext?
Unfortunately Kees and I were doing with with only enough knowledge to be dangerous (Kees did all the real work, I just prodded). I wouldn't be surprised if we made a mistake somewhere along the line.
--Ted
I explored some more and found we have in fact two cairo-based PDF export systems: CairoPdfOutput and CairoRendererPdfOutput. The first is used for save as PDF (I'm not sure what and how is used for PDF print, because I don't know how to "print with PDF" - can anyone please clarify); the second is, as far as I can see, unused (commented out in extension/init.cpp). I have reenabled it and compared the output of these two systems.
The now-disabled CairoRendererPdfOutput:
- supports clipping
- supports font kern pairs (both methods support SVG kerning)
- seems to have a better support for pattern fills and masks - though still broken, but at least has some infrastructure for them
- has a direct access to the document tree, instead of using the print calls as the now-active CairoPdfOutput does
On the other hand, the now-active CairoPdfOutput:
- supports the export-what parameters (canvas, drawing, object id) and text to path
So, based on this comparison, I tend to think that we should purge CairoPdfOutput in favor of CairoRendererPdfOutput. I especially like about the latter that, thanks to direct document tree access, it is much easier to implement things like clipping; adding clipping to CairoPdfOutput would require a quite clumsy and invasive change to the print interface.
So, my question is, does anyone have an idea why CairoPdfOutput was enabled and CairoRendererPdfOutput was disabled in the first place? Was there some limitation of the latter that I'm unaware of? Will anyone object if I add to it the missing parameters and reenable it in place of CairoPdfOutput?
Hi,
I am on vacation so I don't have access to my copy of the Inkscape source but I believe that both versions are being used, the second through the GTK print dialog where one has the option to print to a PDF file.
I've done a bit of playing around with one of the two versions (print dialog, I think) and I have a fix for the pattern rendering bug (basically, there is one too many transformations being applied). I am guessing that this could also effect the clipping and masking routines. There is some code that I don't understand that seems to try to force the pattern size to be an integer number of pixels in width. I am not sure why this is necessary. It would certainly be helpful to understand the history of these routines.
I hope to have some time when I get back from my vacation to spend on these routines. I think that not having good PDF/printing support is the biggest weakness of Inkscape.
Tav
Tav
Hello,
yes we have the two different cairo exporters.
1) the first one come up after Miklos first introduced cairo ( was this an GSOC project ?). this one uses plain cairo calls.
2) the second, which is now used for pdf and ps is integrated into the print subsystem. So printing is now done using this cairo system.
Both where initially created by Miklos. I did some modifications. For me the second has the advantage because it is used for printing as well. However for me it is more complicated to look for the settings within the single ondraw-callbacks. i.e. the copy as bitmap option
HTH,
Adib. ---
On Fri, Jul 25, 2008 at 8:27 PM, bulia byak <buliabyak@...400...> wrote:
I explored some more and found we have in fact two cairo-based PDF export systems: CairoPdfOutput and CairoRendererPdfOutput. The first is used for save as PDF (I'm not sure what and how is used for PDF print, because I don't know how to "print with PDF" - can anyone please clarify); the second is, as far as I can see, unused (commented out in extension/init.cpp). I have reenabled it and compared the output of these two systems.
The now-disabled CairoRendererPdfOutput:
supports clipping
supports font kern pairs (both methods support SVG kerning)
seems to have a better support for pattern fills and masks - though
still broken, but at least has some infrastructure for them
- has a direct access to the document tree, instead of using the print
calls as the now-active CairoPdfOutput does
On the other hand, the now-active CairoPdfOutput:
- supports the export-what parameters (canvas, drawing, object id) and
text to path
So, based on this comparison, I tend to think that we should purge CairoPdfOutput in favor of CairoRendererPdfOutput. I especially like about the latter that, thanks to direct document tree access, it is much easier to implement things like clipping; adding clipping to CairoPdfOutput would require a quite clumsy and invasive change to the print interface.
So, my question is, does anyone have an idea why CairoPdfOutput was enabled and CairoRendererPdfOutput was disabled in the first place? Was there some limitation of the latter that I'm unaware of? Will anyone object if I add to it the missing parameters and reenable it in place of CairoPdfOutput?
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
On Mon, Jul 28, 2008 at 6:01 PM, the Adib <theadib@...1439...> wrote:
Both where initially created by Miklos. I did some modifications. For me the second has the advantage because it is used for printing as well.
So, can't we switch to using the first one for printing as well? I think it's the best way to go, and Miklos agrees that we can now switch to the first one completely now that cairo has got a much better pdf support.
On 7/28/08, bulia byak <buliabyak@...400...> wrote:
On Mon, Jul 28, 2008 at 6:01 PM, the Adib <theadib@...1439...> wrote:
Both where initially created by Miklos. I did some modifications. For me the second has the advantage because it is used for printing as well.
So, can't we switch to using the first one for printing as well? I think it's the best way to go, and Miklos agrees that we can now switch to the first one completely now that cairo has got a much better pdf support.
I'm wondering whether you are not both seeing the same exporter as favorable..
The "first"/older cairo exporter (CairoPdfOutput) uses PrintCairoPDF which implements the Extension::Print interface. It was probably based on the older native pdf exporter (which was based on the older native ps exporter).
The "second"/newer cairo exporter (CairoRendererPdfOutput) implements the Extension::Output interface which means that it is given the full document tree. It uses CairoRenderer and CairoRenderContext internally to do the work (those two are also used by postscript and printing via cairo).
On Mon, Aug 4, 2008 at 12:14 PM, Ulf Erikson <ulferikson@...400...> wrote:
I'm wondering whether you are not both seeing the same exporter as favorable..
I'm referring to the "second"/newer one - I think it is better:
The "first"/older cairo exporter (CairoPdfOutput) uses PrintCairoPDF which implements the Extension::Print interface. It was probably based on the older native pdf exporter (which was based on the older native ps exporter).
The "second"/newer cairo exporter (CairoRendererPdfOutput) implements the Extension::Output interface which means that it is given the full document tree. It uses CairoRenderer and CairoRenderContext internally to do the work (those two are also used by postscript and printing via cairo).
participants (6)
-
unknown@example.com
-
bulia byak
-
Tavmjong Bah
-
Ted Gould
-
the Adib
-
Ulf Erikson