I would embed fonts this way (java):

FontFactory.registerDirectories();
Font fnormal = FontFactory.getFont("Verdana", BaseFont.CP1252,
BaseFont.EMBEDDED, 10);
Font fbold = FontFactory.getFont("Verdana Bold", BaseFont.CP1252,
BaseFont.EMBEDDED, 10);

Note the font Face name is used, therefore no need to specify Font.Normal,
Font.Bold etc.  You can be sure that the correct face is embedded in the
pdf.



Jeff Mogielnicki wrote:
> 
> I am using Itext(1.3.4) to create pdfs, and using hylafax(v4.2.1) as
> the fax server to fax them.  I use gnu-hylafax(v0.0.8.3) as the Java
> API to hylafax.
> 
> Hylafax uses GhostScript to convert the PDFs to gs to fax them.  About
> 30% of the faxes fail because the hylafax converter program (pdf2ps)
> determined that there was a problem:
> 
> "**** Warning:  An error occurred while reading an XREF table.
>    **** The file has been damaged.  This may have been caused
>    **** by a problem while converting or transfering the file.
>    **** Ghostscript will attempt to recover the data.
> Error: /ioerror in --readstring--
> <...snipped...>
> Check any PostScript documents for non-standard fonts and invalid
> constructs."
> 
> All the PDFs in appear fine when viewed in the Acrobat viewer.  When I
> view them in GS (solaris v8.14) it appears fine, but this message is
> shown:
> 
> "Loading NimbusSanL-Regu font from
> /usr/local/share/ghostscript/8.14/lib/fonts/n019003l.pfb... 2257168
> 902873 2169348 879445 3 done.
>    **** Warning: Fonts with Subtype = /TrueType should be embedded.
>                  But Verdana is not embedded.
> Scanning /usr/openwin/lib/X11/fonts/Type1/outline for fonts... 16
> files, 15 scanned, 0 new fonts.
> Substituting font Helvetica for Verdana."
> 
> My document uses the Verdana True type font.  I embed it in the code by:
> 
> ...
>                 bfVerdana = BaseFont.createFont(FONTDIR +
> BODYFONTNAME, BaseFont.CP1252, BaseFont.EMBEDDED);
>                 fontVerdana10 = new Font(bfVerdana, 10, Font.NORMAL);
> ...
> 
> Does anyone have any thoughts on why GS and pdf2ps don't recognize the
> embedded font?
> 
> Thanks in advance for any and all help. Please let me know if I can
> give more information.
> 
> -Jeff
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-Embedded-fonts-tf2075572.html#a5755917
Sent from the iText - General forum at Nabble.com.


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to