Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActivePDF: How do you NOT embed fonts

Status
Not open for further replies.

miteetall

Programmer
Jul 1, 2003
21
US
I dynamically creating a document in ActivePDF and was surprised at the file size, about 500K, for a 3 page file with no graphics. After the file was created, I loaded the file into Adobe Acrobat Pro and removed the embedded Arial font by going under "Advanced->PDF Optimizer->Fonts. It dramatically shrunk the file size by > 10X.

The problem is how do I prevent ActivePDF from embedding fonts in the pdf? Any assistance is greatly appreciated!

Thanks!
 
Thanks for the reply Thomas,

We don't have ActivePDF Server installed on our servers, we currently use ActivePDF Toolkit, and instantiate objects like this:
set PDF = Server.CreateObject("APToolkit.object")

Then to set a font I use the statement:

r=PDF.SetFont("Arial Bold",8)

Again, any assistance is appreciated.

Thanks.



 
Well, certain fonts MUST be embedded, or the document won't display correctly. This from the Toolkit documentation:

If you are not using one of the default fonts, Toolkit attempts to locate the font, using the specified name, in the following order:

1. Input File: Upon opening the input file, Toolkit caches the information contained in the PDF. When locating the specified font, Toolkit attempts to locate the first fully subset font instance in the input file cache.

2. Windows registry: Not finding the file in the input cache, Toolkit will attempt to locate the font information in the Windows registry.

3. Derived Font: If unable to locate the font in the Windows registry, Toolkit generates a substitute font from a similar named font. For example, if the font were set to Arial, Toolkit might generate a font named Arial based on a similar named font, such as ArialMT.

4. Subset: If all of the previous methods are unsuccessful, Toolkit will use the first instance of the partially subset font or similar font from the input cache.

NOTE: When a partially subset font is used, the output may be adversely affected. This can include missing characters, text or graphics, undesired formatting, styles, spacing and font usage.

If you would like to specify an exact font name and location, you can pass the name of a TrueType Font (TTF), Open Type Font (OTF) or TrueType Collection (TTC) located on your hard disk. Unless you specify the full path to the font, Toolkit will assume the font is located in the Windows fonts directory. (By default, the location of this directory is X:\WINDOWS\Fonts.)

NOTE: You cannot specify PostScript (PS) font names and locations. If you would like to use a PS font, you will need to include it in your input file.

This is ambiguous. It seems to say you should use fonts you have installed on the same system that is running Toolkit, but also implies that such fonts will be embedded. You can make sure that embedded fonts are subset, by using the "SubsetFonts" property:

object.SubsetFonts = value

Make the value "false", and Toolkit will subset fonts. That should reduce your filesize.



Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
Thanks again, Thomas

Looks like the Subsetfonts method is only available in the 4.0 version, we are currently running the 3.5.2 version of Toolkit. I tried the SetFlattenedFont method just prior to and after the FlattenRemainingFormFields method and lost all the fonts in the doc in both cases.

Know of any other methods or properties to reduce Toolkit created pdfs?

Thanks
 
Thomas,

Thanks again for your expertise, I'll play with the Adobe Interface a little. I've bookmarked its nice clean site design.

I'm in the KC area, a little east of you, good luck with your consultancy!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top