Hi,

first of all, thanks for this great PDF library.

We need to map some base-14 fonts (the newer ones) to their former set of
base-14 fonts to be downwards compatible (PDF 1.2, Acrobat 3.0), e.g.

  Arial MT -> Helvetica
  Times New Roman PS MT -> Times

We're doing this by inspecting the font dictionary of each page and replacing
the basefont with the corresponding font mapping, if necessary, like this

private static void setBaseFont(PdfDictionary font, PdfName baseFont) {
  font.put(PdfName.BASEFONT, baseFont);
  font.put(PdfName.SUBTYPE, PdfName.TYPE1);
  font.remove(PdfName.FIRSTCHAR);
  font.remove(PdfName.LASTCHAR);
  font.remove(PdfName.FONTDESCRIPTOR);
  font.remove(PdfName.WIDTHS);
}

Is this the preferred way to replace a basefont? Is it necessary to replace
the firstchar, lastchar, fontdescriptor and widths too? The specs say no for
the 14 standard fonts.

Any help will be very welcome. Thanks in advance

Rainer Langbehn




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to