import PDF text also as path

Bug #295564 reported by Pablo Rodríguez
246
This bug affects 48 people
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Wishlist
Unassigned

Bug Description

For some strange reason, inkscape-0.46 offers a menu for handling text in PDF import dialog, but it only shows import text as text.

Wouldn't it be possible to implement the text as path import?

Thanks for your help,

Pablo

dopelover (dopelover)
Changed in inkscape:
status: New → Confirmed
Revision history for this message
Pablo Rodríguez (ousia) wrote :

Thanks for the confirmation.

Don't get me wrong, but it was about to take six months (I wonder how long the fix might take... ).

Thanks again for you work,

Pablo

Revision history for this message
dopelover (dopelover) wrote :

Well I am not programmer so it's best I can do now. For me it is very annoying fault that makes importing PDFs into Inkscape absolutely useles for most cases.

Revision history for this message
spktkpkt (spktkpkt-deactivatedaccount) wrote :

I'm looking for a solution, too.

jazzynico (jazzynico)
Changed in inkscape:
importance: Undecided → Wishlist
tags: added: import-export pdf text
Revision history for this message
eulamue (swim386) wrote :

Wow, this would be a useful feature. Almost all of my work comes in PDF format, and I was just trying Inkscape out for the first time today as an alternative to Illustrator. Fail. I'll try using Inkscape again in a year, though. It is an impressive piece of software that just doesn't quite fit my needs.

Here is an example of the issue I'm having that drove me to this page.

Revision history for this message
thewade (wade-penner) wrote :

This bug effects me, if fixed would help me move away from Illustrator.

Revision history for this message
Beao (beaomail) wrote :

The pdf2svg (http://www.cityinthesky.co.uk/pdf2svg.html) package does this good, if that helps you developers.

su_v (suv-lp)
tags: added: importing
Revision history for this message
DS (dsyphers1) wrote :

The requirement of importing text as text (and doing a very poor job of it) makes Inkscape useless for making posters for scientific conferences. It completely messes up the figures. Back to Keynote, I guess...

Revision history for this message
Levi Kilcher (levi-kilcher) wrote :

Bump.

Any progress on this? Anything I can do?

As a first step, it would be nice to have an import/export option that leaves pdf's (and other imported vector objects) alone, only allowing aspect-ratio-locked scaling.

Is it worth writing a blueprint for this?

Revision history for this message
su_v (suv-lp) wrote :

> Any progress on this? Anything I can do?

You know the answer - provide a patch? ;-)

> As a first step, it would be nice to have an import/export
> option that leaves pdf's (and other imported vector objects)
> alone, only allowing aspect-ratio-locked scaling.

Inkscape is not a PDF editor: AFAIU it needs to convert the contents of PDF files (or other vector formats) into an SVG structure to render it on-canvas. Do you want an 'embed' or 'render frame' feature for PDF (without allowing to edit the contents of the PDF)? IMHO not related to the feature request here (add option to import text as path).

> Is it worth writing a blueprint for this?

Blueprint about your proposal or about the option to import text as path (this bug)? If you have more details other than summarizing what is already in this report, go ahead and write one ;-). Otherwise I don't see how it would help to change the current situation (mainly the lack of developers willing or able to address the issue).

About the requested feature (import text as path):

As a workaround, you can use Ghostscript to convert text in a PDF (or EPS/PS) file to outlines. It requires to convert the PDF to an intermediary PS file, and then back to PDF (thus losing PDF features not supported by PostScript, like transparency).
E.g. use a shell script, containing a command similar to this one:

gs -sDEVICE=pswrite -dNOCACHE -sOutputFile=- -q -dbatch -dNOPAUSE -dQUIET "$1" -c quit | ps2pdf - "`echo $1 | cut -f1 -d'.'`"-nofont.pdf

Better than text as path would be to have support for embedded fonts, i.e. convert the fonts embedded in the PDF or PS file to SVG fonts on import. This would require Inkscape to support rendering of SVG fonts (at the moment, it only can create but not use SVG fonts).

Revision history for this message
DS (dsyphers1) wrote :

"IMHO not related to the feature request here (add option to import text as path)."

Yes, it is related, at least in my opinion. See below.

"Better than text as path would be to have support for embedded fonts..."

I.e., have "import text as text" work properly?

The issue is that imported text is completely mangled. A good first step would be to have imported text look okay, even if it's not editable, or it's only editable as a path. This is what Levi was saying. (And this, for example, is all I need to be able to use eps/pdf figures.) A good _next_ step would be to have imported text editable as text. This is what you were saying, ~suv.

Revision history for this message
su_v (suv-lp) wrote :

@DS - please read the summary of this bug: "import PDF text also as path". This report is _not_ about 'text as text' not working as expected or 'text as text' being mangled (there are other reports filed about better font substitution, and editing of absolutely kerned text resulting from PDF import).

Revision history for this message
su_v (suv-lp) wrote :

… and secondly, "IMHO not related to the feature request here" was referring to the 'embed' or render frame' feature (importing a PDF 'as is', only allowing aspect-ratio-locked scaling).

Revision history for this message
DS (dsyphers1) wrote :

@~suv: have you read (and understood) any of the other comments on this page? Importing text as path is one solution to the problem we're all facing. Yes, the kerning sucks, and it's good to know there are other bug reports about this, but I personally don't need to edit the imported text, and hence importing text as path is a good alternative. This is why the "importing pdf as is" option would also be solution, albeit not the solution originally proposed. I can't speak for Levi, but I assume he proposed it because he thought it would be easier to implement than importing text as path. (It is, for example, what Keynote does.)

"Better than text as path would be to have support for embedded fonts, i.e. convert the fonts embedded in the PDF or PS file to SVG fonts on import."

"Please read the summary of this bug: "import PDF text also as path". This report is _not_ about 'text as text'."

Have you even read your own comments?

Revision history for this message
su_v (suv-lp) wrote :

Possibly I should have answered Levi's other comment in in Bug #219709 “fonts changed on pdf import” (where he mentions this one as related) and not here: these are different aspects of the same, well known problem with keeping appearance and/or editable text when importing PDF/PS/EPS files.

Converting text to path (as requested here) is one option (though it makes text uneditable) and (as workaround) can be achieved with external tools until it is implemented in Inkscape's internal PDF import routines (based on the poppler library). An interim solution could be to add the conversion (gs with '-dNOCACHE') as option to the PDF/PS/EPS import extensions (which would add an additional dialog window before the current one with the preview).

Other options maintaining text as text (improved text editing of abs. kerned text, better and configurable font substitution; conversion of the embedded fonts to SVG fonts) are handled in separate reports and have different requirements or dependencies.

Revision history for this message
su_v (suv-lp) wrote :

> Have you even read your own comments?

Not carefully enough apparently - sorry for repeating me twice. The issue(s) and the need for solutions are well known - the delay in implementing options is not because they are denied or deemed 'Won't fix'.

Revision history for this message
Ben Franske (ben-mm) wrote :

Per the discussion in this blueprint https://blueprints.launchpad.net/inkscape/+spec/vectorize-embedded-fonts it looks like poppler is capable of "vectorizing the embedded font and converting the text to a series of cloned paths" correct? If so, turning that ability on as an "Import Text as Path" option in the import PDF dialog would close this bug report, would it not? This seems like a pretty simple fix to implement.

Revision history for this message
Matthis Thorade (matthis-thorade) wrote :

Here is another example pdf that is not imported properly

Revision history for this message
Darko Veberic (darko-veberic-kit) wrote :

bump.

Revision history for this message
Paul Wohlhart (paul-wohlhart) wrote :

As disussed here https://blueprints.launchpad.net/inkscape/+spec/vectorize-embedded-fonts
evince has a very nice print-to-svg backend now (3.10).

It would we really nice if inkscape also had this functionality.
However, using evince to convert to svg is a viable workaround for now.

Revision history for this message
caizheng (imcaizheng) wrote :

If you have ghostscript version 9.15 or newer inkstalled, simply run
the following command on the command line:

    gs -o target.pdf -dNoOutputFonts -sDEVICE=pdfwrite source.pdf

You will end up with a new pdf file that contains exactly the same
content as the original but with all the text being converted to path.

See:
http://stackoverflow.com/questions/28797418/replace-all-font-glyphs-in-a-pdf-by-converting-them-to-outline-shapes

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.