Difference between revisions of "Current PDF Support"

From Inkscape Wiki
Jump to navigation Jump to search
(Information about PS import needs to be updated (since 0.47, Inkscape uses ps2pdf from Ghostscript for EPS/PS import))
 
(18 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{Needs update}}
== Current PDF support ==
== Current PDF support ==


=== PDF Import ===
=== PDF Import ===


There is currently no support to automatically import PDF files in Inkscape.
SVN version of Inkscape (to-be 0.46) uses poppler (0.5.4 and above) to import PDF files.
 
Implemented features: The new import extension can import paths, text, clippaths, masked or non-masked images, and softmasks. It supports pattern fills (XStep and YStep attributes are ignored) as well as linear and radial gradients (only those using sampled or exponential functions). Gradient meshes are imported, but they get converted to groups of small tiles (flat-colored paths) that approximate the mesh; the user can adjust the precision of this approximation.
 
Only one page can be imported. Users can preview pages and choose the one they need. This is because Inkscape doens't support multiple pages itself.
 
==== Use of Gnulibplot ====
 
A short way for converting files to import in Inkscape is to use
gsview and the command "edit/convert to vector format" to convert any pdf to svg. Easy and fast to use.
Incidentally, gsview invokes a command similar to "pstoedit -f plot-svg ''input-file'' ''output-file''" and, after downloading and installing pstoedit, this command can be run on the command line without opening gsview.


=== PDF Export ===
=== PDF Export ===


<code>pdf_output.inx</code> exports PDF files by first saving them as Postscript and use an external converter to creat PDFs.
PDF export is now supported by main program, using cairo backend (choose Cairo PDF in the save as file requester).
 
Before there was the need from external program :
<code>pdf_output.inx</code> exports PDF files by first saving them as Postscript and use an external converter to creat PDFs, requiring <code>ps2pdf</code> (Installed separately, included in ghostscript)
 
Strengths: Depend of Cairo version.


Requirements:
Weaknesses: Depend of Cairo version.
* <code>ps2pdf</code> (Installed separately)
 
==== Uncompressed PDF Output ====
At this time, it looks as if Inkscape only outputs '''uncompressed''' PDF output.    Once you export a PDF, look at its file size.  If it is too large for your application, then you have different options:
===== epstopdf =====
Export the exact same file to EPS (encapsulated postscript) and then use '''epstopdf''' to convert the file to PDF.  This will make a compressed PDF.
===== Ghostscript =====
An other method utilizing '''Ghostscript[http://www.ghostscript.com/]'''  to compress pdfs.
As an example see:<br />
http://www.itechies.net/blog/archives/1764 (Ghostscript on Windows, English)<br />
A little bit more extensive bash-scripts (therefore for Linux) also using ghostscript can be found here
http://www.alfredklomp.com/programming/shrinkpdf/ (English)<br />
http://blog.tenstral.net/2010/05/pdfs-verkleinern.html (German)<br />
and here<br />
https://dr-luthardt.de/linux.htm?tip=pdfshr (German)<br />


Strengths:
===== Examples =====


Weaknesses:
As an illustration, my 72 page document went from 80 megabytes down to 3.1.


== Current Postscript support ==
== Current Postscript support ==
Line 23: Line 53:


Requirements:
Requirements:
* <code>pstoedit</code> (Installed separately)
* <code>[http://www.pstoedit.net/pstoedit pstoedit]</code> (Installed separately), this tool need a [http://www.pstoedit.net/pstoedit sharware plugin] to support SVG.
* <code>skconvert</code> (Installed separately)
* <code>[http://www.skencil.org skconvert]</code> (Installed separately)


Strengths:
Strengths:
Line 38: Line 68:


Weaknesses:  
Weaknesses:  
* Doesn't support fill patterns and clipping, see bugs 1208874 and 1170322
* Doesn't support fill patterns and clipping, see bugs [http://sourceforge.net/tracker/index.php?func=detail&aid=1208874&group_id=93438&atid=604306 1208874] and [http://sourceforge.net/tracker/index.php?func=detail&aid=1170322&group_id=93438&atid=604306 1170322]
* Postscript doesn't support transparency and Inkscape doesn't emulate this, so they are just ignored, that is you get the color you would get with opacity:1
* Postscript doesn't support transparency and Inkscape doesn't emulate this, so they are just ignored, that is you get the color you would get with opacity:1


== Current Adobe Illustrator support ==
== Current Adobe Illustrator support ==


The files used by [[AdobeIllustrator]] were earlier postscript files but are now Pdf files.
The files used by [[Adobe Illustrator]] were earlier postscript files but are now Pdf files.


=== AI Import ===
=== AI Import ===
==== Pre 9.0 AI files ====


Requirements:
Requirements:
Line 56: Line 88:
* Code is sort of a hack
* Code is sort of a hack
* No maintainer exists for this code
* No maintainer exists for this code
==== 9.0 and above AI files ====
SVN version of Inkscape (to-be 0.46) supports AI files based on PDF (9.0 and above) using same code as for PDF import. All supported features are equivalent to those in the PDF.


=== AI Export ===
=== AI Export ===


<code>ai_output.inx</code> exports Illustrator files by first saving them as Postscript and use an external converter to creat AIs.
<code>ai_output.inx</code> exports Illustrator files by first saving them as Postscript and use an external converter to creat AIs (PostScript based).


Requirements:
Requirements:
Line 67: Line 103:


Weaknesses:
Weaknesses:
[[Category:Developer Documentation]]

Latest revision as of 11:37, 3 March 2012

This page contains outdated information and needs to be updated.

Current PDF support

PDF Import

SVN version of Inkscape (to-be 0.46) uses poppler (0.5.4 and above) to import PDF files.

Implemented features: The new import extension can import paths, text, clippaths, masked or non-masked images, and softmasks. It supports pattern fills (XStep and YStep attributes are ignored) as well as linear and radial gradients (only those using sampled or exponential functions). Gradient meshes are imported, but they get converted to groups of small tiles (flat-colored paths) that approximate the mesh; the user can adjust the precision of this approximation.

Only one page can be imported. Users can preview pages and choose the one they need. This is because Inkscape doens't support multiple pages itself.

Use of Gnulibplot

A short way for converting files to import in Inkscape is to use gsview and the command "edit/convert to vector format" to convert any pdf to svg. Easy and fast to use. Incidentally, gsview invokes a command similar to "pstoedit -f plot-svg input-file output-file" and, after downloading and installing pstoedit, this command can be run on the command line without opening gsview.

PDF Export

PDF export is now supported by main program, using cairo backend (choose Cairo PDF in the save as file requester).

Before there was the need from external program : pdf_output.inx exports PDF files by first saving them as Postscript and use an external converter to creat PDFs, requiring ps2pdf (Installed separately, included in ghostscript)

Strengths: Depend of Cairo version.

Weaknesses: Depend of Cairo version.

Uncompressed PDF Output

At this time, it looks as if Inkscape only outputs uncompressed PDF output. Once you export a PDF, look at its file size. If it is too large for your application, then you have different options:

epstopdf

Export the exact same file to EPS (encapsulated postscript) and then use epstopdf to convert the file to PDF. This will make a compressed PDF.

Ghostscript

An other method utilizing Ghostscript[1] to compress pdfs. As an example see:
http://www.itechies.net/blog/archives/1764 (Ghostscript on Windows, English)
A little bit more extensive bash-scripts (therefore for Linux) also using ghostscript can be found here http://www.alfredklomp.com/programming/shrinkpdf/ (English)
http://blog.tenstral.net/2010/05/pdfs-verkleinern.html (German)
and here
https://dr-luthardt.de/linux.htm?tip=pdfshr (German)

Examples

As an illustration, my 72 page document went from 80 megabytes down to 3.1.

Current Postscript support

PS Import

ps_input.inx imports Postscript files by using two external conversion scripts:

Requirements:

Strengths:

Weaknesses:

PS Export

Inkscape has built-in support to write Postscript files.

Strengths:

  • Outputs nice readable Postscript

Weaknesses:

  • Doesn't support fill patterns and clipping, see bugs 1208874 and 1170322
  • Postscript doesn't support transparency and Inkscape doesn't emulate this, so they are just ignored, that is you get the color you would get with opacity:1

Current Adobe Illustrator support

The files used by Adobe Illustrator were earlier postscript files but are now Pdf files.

AI Import

Pre 9.0 AI files

Requirements:

  • ill2svg.pl requires perl

Strengths:

Weaknesses:

  • Only works on the old Postscript-based Adobe format
  • Code is sort of a hack
  • No maintainer exists for this code

9.0 and above AI files

SVN version of Inkscape (to-be 0.46) supports AI files based on PDF (9.0 and above) using same code as for PDF import. All supported features are equivalent to those in the PDF.

AI Export

ai_output.inx exports Illustrator files by first saving them as Postscript and use an external converter to creat AIs (PostScript based).

Requirements:

  • ps2ai.ps (requires gs)

Strengths:

Weaknesses: