Absolute character positioning in SVG

13 views
Skip to first unread message

Support

unread,
Sep 3, 2009, 8:43:07 PM9/3/09
to PDF2SVG
Q: The SVG generated using the attached PDF has every character
absolutely positioned. Please advise why we end up with SVG like the
following:

<tspan x="3.1243,9.2405,15.357,19.441,24.939" y="89.17" class="ps00
ps218">he sp</tspan>
<tspan x="31.078,37.194,43.31,48.808" y="89.17" class="ps00
ps218">ouse</tspan>
<tspan x="54.946,59.031" y="89.17" class="ps00 ps218"> i</tspan>
<tspan x="61.427" y="89.17" class="ps00 ps218">f</tspan>
<tspan x="64.661,68.746,74.862,78.947" y="89.17" class="ps00 ps218"> a
r</tspan>
...

It should be noted that using another program to convert the PDF to
SVG results in text being grouped into a single tspan per line which
seems preferable?

-----
A: PDF2SVG outputs the SVG in such way because PDF content stream is
using small adjustments between different text runs. The following
content stream was extracted from the input PDF document:

/TT0 1 Tf
-0.002 Tc 0.004 Tw 12 0 0 12 54 746.4 Tm [(DW)-8(E)-5(L)-1(L)-1(I)-4
(NG)-4( P)-5(RO)-4(P)-5(E)-5(RT)-1(Y)5( 1)-6( )]TJ 0 Tc 0 Tw (\226)Tj
12.8 0 Td
( )Tj
-0.002 Tc 0.004 Tw 0.28 0 Td
[(BA)30(S)-5(I)-4(C F)-1(O)-4(RM)]TJ


> using Inkscape to convert the PDF to SVG results in text being grouped
> into a single tspan

This means that this application is not accurately mapping PDF to SVG.
In this case because the inter-character offsets are fairly small, it
may not look like a big deal, but it would not work for many other
files.

Reply all
Reply to author
Forward
0 new messages