Selectable, searchable & copyable text in EPS output

+1 vote
asked Mar 10, 2015 in Wanted features by fred (540 points)
Hello,

It seems that the EPS output generates text outlines (i.e., the shapes of letters) instead of keeping original text.

This may have some advantages if the renderer does not have access to appropriate fonts.

However, this makes it impossible to select, search, or copy text from the generated diagrams.

Is it possible to add an option to keep text as text?

 

Thanks,

Fred
commented Mar 11, 2015 by stephan_sy (200 points)
Hi!
I fully support this request. I would love to have a searchable output format. SVG does not help me since I can include it neither to Latex nor to MSWord ( I have not found a tool that can convert it error free in another format ).
BR
Stephan

1 Answer

0 votes
answered Mar 11, 2015 by plantuml (294,660 points)
selected Mar 12, 2015 by fred
 
Best answer
Hi,

Yet another undocumented and not very tested feature, but you can use -eps:text flag instead on -eps in command line. (It also works with the ant task, with eps:text for format instead on eps).

Tell us if it's working for you : as you've said, the issue is the font availability when the EPS is interpreted.
commented Mar 12, 2015 by fred (540 points)
Hi,

Happy to know about this option!
Thanks.

Unfortunately, the result is incorrect for me (text is too large).

Here is how I proceed:
- generation of eps with PlantUML
- conversion to pdf with epstopdf

epstopdf may have options that could fix this issue.
However, I suppose changing the default font used by PlantUML could do the trick.

Any suggestion as to which font would be identical in Java and epstopdf?

Using pdf output with PlantUML may also be a possibility, but it seems so much easier to rely on plantuml.jar alone + epstopdf that I had to try.


Thanks,

Fred
commented Mar 12, 2015 by stephan_sy (200 points)
edited Mar 12, 2015 by stephan_sy
Hi!

I also tried it. The output does not really look good: The placement of the text in boxes is not centered. The "hnote" boxes are generally too small (or the text is too wide, respectively).

I also tried direct pdf output of plantUML. This looks better, but not as good as the eps output. Unfornunately, in the direct PDF output the text labels of arrows in my sequence diagram are also not searchable because there are strange spaces inserted between the letters.

BR
Stephan
commented Mar 12, 2015 by fred (540 points)
Hello,

Thanks for your evaluation of PDF output. I will not need to try it ;-).

Looks like the only possibility (apart from changing the implementation) is to try using another font.


Best regards,

Fred
commented Mar 16, 2015 by stephan_sy (200 points)
Hi!

I looked at the eps output in a text editor: In my example the only used font is "SansSerif", which seems not to exist at least for ghostscript.

Then I did a experiment: I replaced everywhere "SansSerif" with "Helvetica". And now the pdf output looks great and is searchable.

For know I will use a script to automatic replace of the font in the Eps output.

Looking at the Eps output of Inkscape ( converting the svg file) I see that a lot of font information is added. I assume that one can embedded the fonts also to the eps file?

BR
Stephan
...