Meta Image (Native) Commands
The following command line arguments to Image to PDF are ones that deal with the conversion of meta images (ie WMF or EMF images).
If possible try converting a meta image to native PDF commands (using -MetaToNativePDF below). This gives much better quality and a smaller
PDF size too. However, it is not possible to convert all possible meta image commands into native PDF equivalent commands so the conversion
may not be 100% accurate.
If you do not convert to native PDF then a meta image is rendered into an image bitmap using Windows to perform the rendering.
This results in a non-scalable and larger sized PDF but should be a pretty accurate conversion (using -MetaImageMaxMP and associated commands).
Font Support
All TrueType fonts which have a Unicode CMAP font resource (which defines the names of the glyphs available) within their font definition can be
used successfully within the "native" PDF conversion. If a font that is used within a meta image cannot be used then a default font is substituted
(see -MetaDefaultFont).
It is not possible to convert all Unicode characters that may be used, but the ones in the following Unicode codepages are mostly supported:
CP874 (Thai), CP1250 (Latin2), CP1251 (Cyrillic), CP1252 (Latin1), CP1253 (Greek), CP1254 (Turkish), CP1255 (Hebrew), CP1256 (Arabic), CP127 (Baltic).
Additionally, Arabic contextual forms (initial, medial, final and isolated) are supported through the use of the -UseArabicContextualForms command.
|
-MetaToNativePDF |
Parameters: |
None |
Notes: |
Converts a meta image file into a native PDF representation (does not render into an image but converts meta image commands directly into equivalent native PDF
graphic and text functions).
This does ensure that any text that was in the meta image file is text in the PDF and is therefore searchable.
This may not be a perfect representation as there are features of meta image files that just cannot be duplicated using the native PDF facilities. However the PDF files produced are much smaller in filesize and usually of higher quality too.
|
|
-CenterMetaImageOnPage |
Parameters: |
None |
Notes: |
Rather than using a manual combination of -MetaMargins and -Border commands to try and get a native rendered
page to have the contents centered on the page, this command will perform this automatically based on the
content of the meta image that is actually rendered into the PDF.
|
|
-MetaTextFitBoundingRect |
Parameters: |
None |
Notes: |
If text in a meta image file is larger than the defined bounding rectangle this command will progressively reduce the font size until it can fit the text
within the defined bounding area.
Depending on the composition of your meta image file it is sometimes better (with the text being more legible) if the text is allowed to extend outside the defined bounding rectangle (as long as there is nothing immediately next to it of course).
Note: This only works if -MetaToNativePDF has been used.
|
|
-MetaMargins |
Parameters: |
None |
Notes: |
By default a meta image file is rendered as an image that is just large enough to enclose it.
This command overrides this behaviour for those situations where you want to preserve the margins around the image (no matter how large they might be).
|
|
-UseEMFDeviceSize |
Parameters: |
None |
Notes: |
By default the dimensions (ie size) of an EMF image is determined by using the declared bounding rectangle which is stored as part of the meta file.
Sometimes (and this depends on the application that created it) this can lead to a distorted (ie incorrectly sized) image. If this appears to be the case
then try using this command which ignores the declared bounding rectangle and uses the declared reference device pixel size (again some applications may not
set this correctly - although one would hope that at least one of these three - see also UseEMFFrameSize - settings has been correctly set!).
|
|
-UseEMFFrameSize |
Parameters: |
None |
Notes: |
By default the dimensions (ie size) of an EMF image is determined by using the declared bounding rectangle which is stored as part of the meta file.
Sometimes (and this depends on the application that created it) this can lead to a distorted (ie incorrectly sized) image. If this appears to be the case
then try using this command which ignores the declared bounding rectangle and uses the declared frame size in millimeters which is converted into a pixel size
(again some applications may not set this correctly - although one would hope that at least one of these three - see also UseEMFDeviceSize - settings has been correctly set!).
|
|
-LogFontInfo |
Parameters: |
None |
Notes: |
When the -MetaToNativePDF command is used it can be useful to see the results of the font matching that is performed when it is necessary to convert a font reference in the meta image file to an actual font that is available for inclusion in the PDF.
If a font cannot be matched then a default Helvetica font is used if the original font was determined as being of a proportional type or a default of Courier is used if it was determined as being of a mono-spaced type.
|
|
-LogFontCharacters |
Parameters: |
None |
Notes: |
When the -MetaToNativePDF command is used it can be useful to see what characters are within a Truetype font definition and this command will list all Unicode characters cross-referenced with their internal glyph index.
|
|
-MetaDefaultFont |
Parameters: |
font name - must be one of the following standard PDF fonts:
Courier
Courier-Bold
Courier-BoldOblique
Courier-Oblique
Helvetica
Helvetica-Bold
Helvetica-BoldOblique
Helvetica-Oblique
Times-Roman
Times-Bold
Times-Italic
Times-BoldItalic
|
Notes: |
This command can only be used in conjunction with the -MetaToNativePDF command.
If a font cannot be matched then this allows the specification of one of the standard PDF fonts to be used.
If this is not specified then a default Helvetica font is used if the original font was determined as being of a proportional type or a default of Courier is used if it was determined as being of a mono-spaced type.
See also -MetaDefaultFontXScaling command below.
|
|
-MetaDefaultFontXScaling |
Parameters: |
scale - must be a value between 0.01 and 100.0 inclusive.
|
Notes: |
This command can only be used in conjunction with the -MetaToNativePDF command.
If a default font is used because the original font cannot be matched (see -MetaDefaultFont command above) then it may be necessary to use this command
to scale the font width so that it better approximates the size and shape characteristics of the original font.
|
|
-MetaToNativeFontSubstitution |
Parameters: |
substitution description - text (up to 500 characters) specifying the font and character(s) substitution (if spaces are required then enclose within quotes) as follows:
<original font name>=<substitute font name>:<original character code>=<substitute character code>{,<original character code>=<substitute character code>}
<original character code> can be an ASCII code (32 to 255) or Unicode code or a ? (which matches all characters not substituted)
<substitute character code> must be an ASCII code (32 to 255) - the character output is the code in the font specified (which is not necessarily a letter but could be a symbol)
|
Notes: |
This command can only be used in conjunction with the -MetaToNativePDF command.
If a font cannot be matched (perhaps because it is not a True Type font with a CMAP record) then this allows an alternative font and specific character substitutions to be made.
This is commonly used to substitute non-textual (symbolic) fonts, for example WingDings (click here for a list of the glyphs in the various WingDings fonts and to see the list of available ZapgDingbats glyphs).
You can specify multiple character substitutions by separating the <original character code>=<substitute character code> mappings with commas.
Up to 100 substitution strings can be setup and they are processed for a match in the order that they are defined.
You cannot specify different font substitutions for the same font - ie if you define that WingDings is substituted for ZapfDingbats you cannot also define that WingDings is substituted for another font.
A non-standard font, such as WingDings, is normally recorded in unicode as being in the Private Use Area (PUA) range of codes which are from F000 to F0FF (in hexadecimal). When specifying the substitutions you do not specify the full PUA code but just the actual character code from 0 to 255.
|
|
-UseArabicContextualForms |
Parameters: |
None |
Notes: |
This command can only be used in conjunction with the -MetaToNativePDF command.
By default, when Arabic Unicode text is used (codepage CP1256) the Arabic glyphs do not take into account the context and relationship
with other Arabic and non-Arabic text. This command will enable the analysis of the surrounding text in order to change the glyph to one of
the contextual Arabic alternatives (known as initial, medial, final and isolated forms).
It should be noted that not all available Arabic supporting fonts have all of the required Arabic contextual form characters, and therefore
the output will feature non-available glyphs (shown as an outlined rectangular shape).
|
|
-EmbedFonts |
Parameters: |
None |
Notes: |
This command can only be used in conjunction with the -MetaToNativePDF command.
If a document is converted which uses an unusual font that is not likely to be installed on a target system then this
command will ensure that all of the font details are embedded within the PDF so that the target system that a PDF may be viewed on
does not require the font in order to display the text within the PDF correctly.
It should be noted that this will increase the file size of the produced PDF - but that may be a small price to pay to ensure that
all users can view the PDF correctly.
|
|
-ForceFontScaling |
Parameters: |
multiply - must be a value greater than 0.
divide - must be a value greater than 0.
|
Notes: |
This command can only be used in conjunction with the -MetaToNativePDF command.
Some applications may incorrectly produce a preview meta file for display on screen which has different font scaling characteristics to that of the final non-preview rendered meta file.
In these circumstances it may be necessary to apply a correction factor to text font sizing so that the rendered meta file matches the preview. This is performed by mutliplying the font size by the multiply value and then dividing by the divide value.
|
|
-MetaSplitPDFOnTextChange |
Parameters: |
flag text - identifying text (up to 50 characters) that flags the following text as the important text that when it changes forces a new PDF to be created.
|
Notes: |
This command can only be used in conjunction with the -MetaToNativePDF command.
This command is useful when a large run of image meta files have been produced that need batching up into separate PDFs according to some identifying text that appears in them, eg an account number.
The flag text is case sensitive as is the important text immediately following the flag text. The important text can be up to 100 characters long and must occur within the same EMF text record as the flag text, eg "Account: ABC123" in one meta image document and "Account: XYZ123" in another meta image document will cause separate PDFs to be created for each account.
The PDF names have a hyphen and four digit number appended to the base PDF name, eg "account.pdf" using the previous example would produce "account-0001.pdf" and "account-0002.pdf".
It is important to note that whenever the important text changes a new PDF will be generated but with an incremented numeric suffix.
|
|
-MetaTextCharacterSpacing |
Parameters: |
None |
Notes: |
This command can only be used in conjunction with the -MetaToNativePDF command.
This command is ignored if -MetaTextFitBoundingRect is used or the text angle is not zero (ie not horizontal).
This command is useful if the text within a meta file has had it's letter positioning micro-managed (eg when fully justifying a line in an application which may not only increase spacing between words but adjust the inter-character gap) and the text is not being displayed in exactly the correct position.
Using this command will make the output PDF file size larger (the exact amount depends on the number of characters in the text) as instead of one text run in a line there will be a text run for each character which is why this option should only be used if absolute text accuracy is required (in most situations this option is not necessary).
|
|
-AdjustTextForLeading |
Parameters: |
None |
Return Value: |
None |
Notes: |
This command can only be used in conjunction with the -MetaToNativePDF command.
This command is useful if the text position is not appearing in the correct position (i.e. the baseline of the text is too high).
This forces the text rendering to take into account the font leading that is part of a font's definition.
|
|
-ForceCodepage |
Parameters: |
codepage - must be one of the following values:
0 - no forcing of codepage (use codepage specified)
874 - Thai
932 - ShiftJIS
936 - GB2312
949 - Hangul
950 - Chinese BIG5
1250 - East Europe
1251 - Russian
1252 - ANSI
1253 - Greek
1254 - Turkish
1255 - Hebrew
1256 - Arabic
1257 - Baltic
|
Notes: |
Sometimes when converting a WMF image file the codepage used with text does not
get correctly translated (due to Windows internal WMF to EMF conversion routines).
This command allows this to be corrected by forcing all text to use the specified codepage.
|