How to specify font locations for PDF2SVG

270 views
Skip to first unread message

Ryan

unread,
Jul 16, 2014, 12:38:04 PM7/16/14
to pdfne...@googlegroups.com
Q:
How does PDF2SVG determine where fonts are located? On windows is it just c:\windows\fonts?

----------------------------------------------------------------------------------------------------------
A:
The latest version of PDF2SVG now supports the option to pass in a xml file that specifies font substitutions. An example xml file is attached.

pdf2svg.exe --config config.xml in.pdf -o outdir

See the following documentation for how this file works.
http://www.pdftron.com/pdfnet/docs/PDFNetC/d9/d87/classpdftron_1_1_p_d_f_net.html#ab207296de9f0bef798345d52d272e7df

And here is an example xml file (or see attached).

<?xml version="1.0" encoding="utf-8" ?>
<config>
 
<!-- This configuration file is used to customize the font substitution. -->
 
<fonts>

 
<!-- An explicit font map could be used to map specific font names
       to font files. For example:  -->


 
<subst name="HGGothicE"         file="C:\Windows\Fonts\HGRGE.TTC"/>
 
<subst name="HGPGothicE"        file="C:\Windows\Fonts\HGRGE.TTC"/>
 
<subst name="HGSGothicE"        file="C:\Windows\Fonts\HGRGE.TTC"/>
 
<subst name="HGGothicM"         file="C:\Windows\Fonts\HGRGM.TTC"/>
 
<subst name="HGPGothicM"        file="C:\Windows\Fonts\HGRGM.TTC"/>
 
<subst name="HGSGothicM"        file="C:\Windows\Fonts\HGRGM.TTC"/>
 
<subst name="HGMaruGothicMPRO"  file="C:\Windows\Fonts\HGRSMP.TTF"/>
 
<subst name="HGKyokashotai"     file="C:\Windows\Fonts\HGRKK.TTC"/>
 
<subst name="HGPKyokashotai"    file="C:\Windows\Fonts\HGRKK.TTC"/>
 
<subst name="HGSKyokashotai"    file="C:\Windows\Fonts\HGRKK.TTC"/>
 
<subst name="HGGyoshotai"       file="C:\Windows\Fonts\HGRGY.TTC"/>
 
<subst name="HGPGyoshotai"      file="C:\Windows\Fonts\HGRGY.TTC"/>
 
<subst name="HGSGyoshotai"      file="C:\Windows\Fonts\HGRGY.TTC"/>
 
<subst name="HGSeikaishotaiPRO" file="C:\Windows\Fonts\HGRSKP.TTF"/>
 
<subst name="HGSoeiPresenceEB"  file="C:\Windows\Fonts\HGRPRE.TTC"/>
 
<subst name="HGPSoeiPresenceEB" file="C:\Windows\Fonts\HGRPRE.TTC"/>
 
<subst name="HGSSoeiPresenceEB" file="C:\Windows\Fonts\HGRPRE.TTC"/>
 
<subst name="HGSoeiKakugothicUB" file="C:\Windows\Fonts\HGRSGU.TTC"/>
 
<subst name="HGPSoeiKakugothicUB" file="C:\Windows\Fonts\HGRSGU.TTC"/>
 
<subst name="HGSSoeiKakugothicUB" file="C:\Windows\Fonts\HGRSGU.TTC"/>
 
<subst name="HGSoeiKakupoptai"  file="C:\Windows\Fonts\HGRPP1.TTC"/>
 
<subst name="HGPSoeiKakupoptai" file="C:\Windows\Fonts\HGRPP1.TTC"/>
 
<subst name="HGSSoeiKakupoptai" file="C:\Windows\Fonts\HGRPP1.TTC"/>
 
<subst name="HGMinchoB"         file="C:\Windows\Fonts\HGRMB.TTC"/>
 
<subst name="HGPMinchoB"        file="C:\Windows\Fonts\HGRMB.TTC"/>
 
<subst name="HGSMinchoB"        file="C:\Windows\Fonts\HGRMB.TTC"/>
 
<subst name="HGMinchoE"         file="C:\Windows\Fonts\HGRME.TTC"/>
 
<subst name="HGPMinchoE"        file="C:\Windows\Fonts\HGRME.TTC"/>
 
<subst name="HGSMinchoE"        file="C:\Windows\Fonts\HGRME.TTC"/>
 
<subst name="MSGothic"         file="C:\Windows\Fonts\msgothic.ttc"/>
 
<subst name="MSPGothic"        file="C:\Windows\Fonts\msgothic.ttc"/>
 
<subst name="MSUIGothic"        file="C:\Windows\Fonts\msgothic.ttc"/>
 
<subst name="MSMincho"         file="C:\Windows\Fonts\msmincho.ttc"/>
 
<subst name="MSPMincho"        file="C:\Windows\Fonts\msmincho.ttc"/>
 
<subst name="Meiryo"            file="C:\Windows\Fonts\meiryo.ttc"/>
 
<subst name="MeiryoItalic"     file="C:\Windows\Fonts\meiryo.ttc"/>
 
<subst name="MeiryoBold"       file="C:\Windows\Fonts\meiryob.ttc"/>
 
<subst name="MeiryoBoldItalic" file="C:\Windows\Fonts\meiryob.ttc"/>

   
<!--subst collection="Japan1" file="C:\Program Files (x86)\Adobe\Reader 9.0\Resource\CIDFont\KozGoPr6N-Medium.otff"/>
  <subst collection="Japan2" file="C:\Program Files (x86)\Adobe\Reader 9.0\Resource\CIDFont\KozGoPr6N-Medium.otf"/ -->

</fonts>
</config>


config.xml

Shamit Verma

unread,
Oct 14, 2014, 8:21:42 AM10/14/14
to pdfne...@googlegroups.com
Can this config file be utilized from API as well (PDFNet, API for conversion of PDF to SVG).

Regards,
Shamit

Aaron

unread,
Oct 14, 2014, 1:30:49 PM10/14/14
to pdfne...@googlegroups.com
From the PDFNet SDK API, you can use PDFNet::AddFontSubst:

http://www.pdftron.com/pdfnet/PDFNet/html/Overload_pdftron_PDFNet_AddFontSubst.htm
Reply all
Reply to author
Forward
0 new messages