![]() | InDesign SDK 20.5 |
#include <IXMLExportUtils.h>

Public Types | |
| enum | { kDefaultIID = IID_IXMLEXPORTUTILS } |
| enum | ExportImageOption { kCopyOriginal, kOptimizeOriginal, kFormatOriginal } |
Public Member Functions | |
| virtual ErrorCode | GenerateOptimizedImage (const IPMUnknown *pageItem, IPMStream *outStream, const IXMLExportOptions *options, const PMReal &desiredWidth=0)=0 |
| virtual ErrorCode | GenerateFormattedImage (const IPMUnknown *pageItem, IPMStream *outStream, const IXMLExportOptions *options, bool32 includeFrameInRendering=kTrue, bool16 bItemBackgroundExportAsPng=kFalse, bool16 bDrawNonPrintingObjects=kTrue, PMReal greekBelowPtSize=0.0)=0 |
| virtual IXMLExportOptions::ImageType | GetBestOptimizedImageType (const IPMUnknown *pageItem) const =0 |
| virtual IXMLExportOptions::ImageType | GetBestFormattedImageType (const IPMUnknown *pageItem, bool16 shouldKeepSVGAsEmbededSVGImage=kFalse) const =0 |
| virtual void | CopyOriginal (IXMLOutStream *stream, const IDFile &imagesFolder, ILinkObject *iLinkObject, ExportSessionToken sessionToken, const PMString *linkName=nil) const =0 |
| virtual void | CopyOriginal (IXMLOutStream *stream, const IDFile &imagesFolder, const IDFile &sourceFile, ExportSessionToken sessionToken) const =0 |
| virtual void | OptimizeOriginal (IXMLOutStream *stream, IXMLExportOptions *exportOptions, const IDFile &imagesFolder, ILinkObject *iLinkObject, ExportSessionToken sessionToken, const PMReal &desiredWidth=0) const =0 |
| virtual void | FormatOriginal (IXMLOutStream *stream, IXMLExportOptions *exportOptions, const IDFile &imagesFolder, ILinkObject *iLinkObject, const XMLReference *element, ExportSessionToken sessionToken, bool32 includeFrameInRendering=kTrue) const =0 |
| virtual bool16 | HasTransparency (const IPMUnknown *pageItem) const =0 |
| virtual PMString | GetDestinationImageName (ExportImageOption exportImageOption, const IDFile &imagesFolder, ILinkObject *iLinkObject, const IXMLExportOptions *exportOptions, bool16 overwriteDestination=kFalse) const =0 |
| virtual void | WriteDocumentHeader (IXMLOutStream *xmlStream, IXMLExportOptions *exportOptions, const PMString &rootName) const =0 |
| virtual void | OpenFileInApp (const IDFile &appFile, const PMString &fileURL) const =0 |
| virtual bool32 | NeedsRasterizationOrSVG (const IPMUnknown *imageItem, bool32 checkForRotationOrSkew=kTrue, bool32 checkForTransparency=kTrue, bool32 checkForImageClipping=kTrue, bool32 checkForFrameCropping=kTrue, bool32 checkForVectorGraphic=kTrue) const =0 |
| virtual bool16 | isSVGItem (const IPMUnknown *imageItem) const =0 |
| virtual void | OptimizeOriginal2 (IXMLOutStream *stream, IXMLExportOptions *exportOptions, const IDFile &imagesFolder, bool32 useOriginalImageNameOnly, ILinkObject *iLinkObject, ExportSessionToken sessionToken, const PMReal &desiredWidth=0) const =0 |
| virtual void | FormatOriginal2 (IXMLOutStream *stream, IXMLExportOptions *exportOptions, const IDFile &imagesFolder, bool32 useOriginalImageNameOnly, ILinkObject *iLinkObject, const XMLReference *element, ExportSessionToken sessionToken, bool32 includeFrameInRendering=kTrue) const =0 |
| virtual ErrorCode | GenerateFormattedImageForText (const IPMUnknown *pageItem, IPMStream *outStream, const IXMLExportOptions *options, bool32 includeFrameInRendering=kTrue, bool16 bItemBackgroundExportAsPng=kTrue, bool16 excludeText=kFalse)=0 |
| virtual PMRect | GetPrintedBBoxForTextFrame (const UIDRef &textFrameRef, const PMMatrix &theMatrix, const Transform::CoordinateSpace &coordinateSpace, bool32 includeAdornments=kTrue)=0 |
| virtual ErrorCode | GenerateFormattedImage2 (const IPMUnknown *pageItem, IPMStream *outStream, const IXMLExportOptions *options, bool32 includeFrameInRendering=kTrue, bool16 bItemBackgroundExportAsPng=kFalse, bool16 bDrawNonPrintingObjects=kTrue, PMReal greekBelowPtSize=0.0, bool16 includeOtherBackgroundObjects=kFalse)=0 |
| virtual ErrorCode | GenerateFormattedImageForText2 (const IPMUnknown *pageItem, IPMStream *outStream, const IXMLExportOptions *options, bool32 includeFrameInRendering=kTrue, bool16 bItemBackgroundExportAsPng=kTrue, bool16 excludeText=kFalse, bool16 includeOtherBackgroundObjects=kFalse)=0 |
| virtual void | CopyOriginal (IXMLOutStream *stream, const IDFile &imagesFolder, ILinkResource *iLinkResource, ExportSessionToken sessionToken, const PMString *linkName=nil) const =0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
Export related utility interface; used by the current XML export provider.
ExportImageOption are required as a parameter in GetDestinationImageName()
| Enumerator | |
|---|---|
| kCopyOriginal | Copies the original image. See CopyOriginal(). |
| kOptimizeOriginal | Optimizes the image. See OptimizeOriginal(). |
| kFormatOriginal | Generates a formatted image. See FormatOriginal(). |
| pure virtual |
There are three graphics related XML export options (Copy Original, Optimize Original, and FormatOriginal). This option copies the original image. Managed source images are supported.
| stream | specifies the XML output stream with IID_XMLCOPYMAP, which is being used to avoid copying images twice. |
| imagesFolder | specifies the target folder where the original image will be copied to |
| iLinkObject | specifies the pageitem of the original image. |
| sessionToken | identifies the export session that owns the resulting file |
| linkName | specifies the name of the link in links panel |
| pure virtual |
Given the original image file, copies it to imagesFolder. Managed source images are supported.
| stream | specifies the XML output stream with IID_XMLCOPYMAP, which is being used to avoid copying the same image twice. |
| imagesFolder | specifies the target folder where the original image will be copied to |
| sourceFile | specifies the original image. |
| sessionToken | identifies the export session that owns the resulting file |
| pure virtual |
Given the original image file, copies it to imagesFolder. Managed source images are supported.
| stream | specifies the XML output stream with IID_XMLCOPYMAP, which is being used to avoid copying the same image twice. |
| imagesFolder | specifies the target folder where the original image will be copied to |
| linkResource | specifies the link resource abstraction over original image. |
| sessionToken | identifies the export session that owns the resulting file |
| linkName | specifies the name of the link in links panel |
| pure virtual |
There are three graphics related XML export options (Copy Original, Optimize Original, and FormatOriginal). This option generates a new image based on the formatting and transformation that is being used. This util method is currently used by XMLExportProvider and PackageDoc4GLCmd. It uses GenerateOptimizedImage() and GetBestOptimizedImageType().
| stream | specifies the XML output stream with IID_IXMLFORMATTEDMAPDATA, which is being used to retrieve the converted file name. An image is always converted because the transformation may be different from image to image. |
| exportOptions | provides the chosen image type for the image conversion. See IXMLExportOptions::GetImageType(). |
| imagesFolder | specifies the target folder where the original image will be copied to. |
| iLinkObject | specifies the pageitem of the original image. |
| element | specifies XMLReference that will be updated with the URL of the new formatted image. |
| sessionToken | identifies the export session that owns the resulting file |
| includeFrameInRendering | [IN] For graphics, determines whether the parent frame is included in the generated raster. |
| pure virtual |
There are three graphics related XML export options (Copy Original, Optimize Original, and FormatOriginal). This option generates a new image based on the formatting and transformation that is being used. This util method is currently used by XMLExportProvider and PackageDoc4GLCmd. It uses GenerateOptimizedImage() and GetBestOptimizedImageType().
| stream | specifies the XML output stream with IID_IXMLFORMATTEDMAPDATA, which is being used to retrieve the converted file name. An image is always converted because the transformation may be different from image to image. |
| exportOptions | provides the chosen image type for the image conversion. See IXMLExportOptions::GetImageType(). |
| imagesFolder | specifies the target folder where the original image will be copied to. |
| iLinkObject | specifies the pageitem of the original image. |
| element | specifies XMLReference that will be updated with the URL of the new formatted image. |
| sessionToken | identifies the export session that owns the resulting file |
| useOriginalImageNameOnly | [IN] whether to add any prefix or suffix to original image name (eg "_fmt"). |
| includeFrameInRendering | [IN] For graphics, determines whether the parent frame is included in the generated raster. |
| pure virtual |
Creates an RGB snapshot of the pageItem as it appears in the pub. That is, if the pageItem is rotated in the pub, then an image will be generated containing the rotated pageItem. In addition, if the pageitem has a containing frame, the frame will also be part of the image thus preserving clipping.
| pageItem | specifies page item to be rasterised |
| outStream | where to write the pixels |
| options | interface (IXMLExportOptions) storing options for the image generation process |
| includeFrameInRendering | [IN] For graphics, determines whether the parent frame is included in the generated raster. |
| bItemBackgroundExportAsPng[IN] | used to explicitly set PNG as export format |
| bDrawNonPrintingObjects[IN] | used to explicitly draw non-printing objects |
| greekBelowPtSize | - IN - Point size at which text will be greeked if its points size multiplied by the scaling is less than the greek below value. |
| pure virtual |
Creates an RGB snapshot of the pageItem as it appears in the pub. That is, if the pageItem is rotated in the pub, then
an image will be generated containing the rotated pageItem. In addition, if the pageitem has a containing frame, the frame will also be part of the image thus preserving clipping.
| pageItem | specifies page item to be rasterised |
| outStream | where to write the pixels |
| options | interface (IXMLExportOptions) storing options for the image generation process |
| includeFrameInRendering | [IN] For graphics, determines whether the parent frame is included in the generated raster. |
| bItemBackgroundExportAsPng[IN] | used to explicitly set PNG as export format |
| bDrawNonPrintingObjects[IN] | used to explicitly draw non-printing objects |
| greekBelowPtSize | - IN - Point size at which text will be greeked if its points size multiplied by the scaling is less than the greek below value. |
| includeOtherBackgroundObjects | - IN - determines whether page items behind input page item is included in the generated raster. |
| pure virtual |
Creates an RGB snapshot of the pageItem as it appears in the pub. That is, if the pageItem is rotated in the pub, then an image will be generated containing the rotated pageItem. In addition, if the pageitem has a containing frame, the frame will also be part of the image thus preserving clipping.
| pageItem | specifies page item to be rasterised |
| outStream | where to write the pixels |
| options | interface (IXMLExportOptions) storing options for the image generation process |
| includeFrameInRendering | [IN] For graphics, determines whether the parent frame is included in the generated raster. |
| bItemBackgroundExportAsPng[IN] | used to explicitly set PNG as export format |
| excludeText[IN] | determines whether to exclude text in the exported image |
| pure virtual |
Creates an RGB snapshot of the pageItem as it appears in the pub. That is, if the pageItem is rotated in the pub, then
an image will be generated containing the rotated pageItem. In addition, if the pageitem has a containing frame, the frame will also be part of the image thus preserving clipping.
| pageItem | specifies page item to be rasterised |
| outStream | where to write the pixels |
| options | interface (IXMLExportOptions) storing options for the image generation process |
| includeFrameInRendering | [IN] For graphics, determines whether the parent frame is included in the generated raster. |
| bItemBackgroundExportAsPng[IN] | used to explicitly set PNG as export format |
| excludeText[IN] | determines whether to exclude text in the exported image |
| includeOtherBackgroundObjects[IN] | - determines whether page items behind input page item is included in the generated raster. |
| pure virtual |
Creates an RGB version of the image at a resolution equal to the smaller of 72 dpi and the native image resolution. Geometrical transformations, clipping, and any containing frames will not be included in the resulting image.
| pageItem | specifies page item to be rasterised |
| outStream | where to write the pixels |
| options | interface (IXMLExportOptions) storing options for the image generation process |
| desiredWidth | [IN] if non-zero and less than or equal to the original image width, resample the image uniformly such that its target width matches this given width. |
| pure virtual |
The user has a choice at export time of selecting GIF, JPEG or Automatic as the image type. GetBestFormattedImageType() can be used to detect which type will be used when exporting a formatted image of the given pageItem.
| pageItem | specifies page item to be rasterised |
| shouldKeepSVGAsEmbededSVGImage | specifies if best format for SVG is embeded SVG Image |
| pure virtual |
The user has a choice at export time of selecting GIF, JPEG or Automatic as the image type. GetBestOptimizedImageType() can be used to detect which type will be used when exporting an optimized image of the given pageItem.
| pageItem | specifies page item to be rasterised |
| pure virtual |
There are three graphics related XML export options (Copy Original, Optimize Original, and FormatOriginal). This option generates the file name of the destination image based on export image option (copy, optimized, or formatted).
| exportImageOption | specifies whether the destination name should be generated for CopyOriginal(), OptimizeOriginal, or FormatOriginal(). |
| exportOptions | provides the chosen image type for the image conversion. See IXMLExportOptions::GetImageType(). |
| iLinkObject | specifies the pageitem of the original image. |
| overwriteDestination | specifies whether the destination file can be overwritten or whether a file with a unique name should be used instead. Defaulted to kFalse. |
| pure virtual |
Get the bounds around what will actually print. This includes the stroke bounds plus whatever adornments are set to print and also the optical alignment margins. Compute the bounds in pasteboard coords and then transform by theMatrix.
| theMatrix | the matrix to transform the bounds based on pasteboard coordinates. |
| includeAdornments | [IN] Whether or not printing adornments are included in the resulting bounding box |
| pure virtual |
Returns true if the pageitem or any of its ancestors has transparency applied to it.
| pageItem | [IN] pointer to an interface on a page item. |
| pure virtual |
Does this graphic is a SVG?
| imageItem | [IN] pointer to an interface on the image or graphic |
| pure virtual |
Does this image, and its parent frame, need to be rasterized due to a 2D transform, transparency, clipping paths or a frame that in some way clips the image.
| imageItem | [IN] pointer to an interface on the image |
| checkForRotationOrSkew | [IN] Should we check for a rotation or skew relative to the spread? |
| checkForTransparency | [IN] Should we check for transparency anywhere in this image's hierarchy? |
| checkForImageClipping | [IN] Should we check for a clipping path on the image? |
| checkForFrameCropping | [IN] Should we check for the frame cropping the image in some way? |
| checkForVectorGraphic | [IN] Should we check whether this image is actually a vector graphic such as an EPS or PDF? |
| pure virtual |
OpenFileInApp calls private OpenFileInHelper() in LaunchXMLViewer.cpp. It launches the application specified in appFile and passes the fileURL als parameter for the file or site to open.
| appFile | browser or any other application. |
| fileURL | specifies the URL that appFile should open. |
| pure virtual |
There are three graphics related XML export options (Copy Original, Optimize Original, and FormatOriginal). This option uses image conversion for optimizing images. It uses GenerateOptimizedImage() and GetBestOptimizedImageType().
| stream | specifies the XML output stream with IID_XMLOPTIMIZEDMAP, which is being used to avoid converting the same image twice. |
| exportOptions | provides the chosen image type for the image conversion. See IXMLExportOptions::GetImageType(). |
| imagesFolder | specifies the target folder where the original image will be copied to. |
| iLinkObject | specifies the pageitem of the original image. |
| sessionToken | identifies the export session that owns the resulting file |
| desiredWidth | [IN] if non-zero and less than or equal to the original image width, resample the image uniformly such that its target width matches this given width. |
| pure virtual |
There are three graphics related XML export options (Copy Original, Optimize Original, and FormatOriginal). This option uses image conversion for optimizing images. It uses GenerateOptimizedImage() and GetBestOptimizedImageType().
| stream | specifies the XML output stream with IID_XMLOPTIMIZEDMAP, which is being used to avoid converting the same image twice. |
| exportOptions | provides the chosen image type for the image conversion. See IXMLExportOptions::GetImageType(). |
| imagesFolder | specifies the target folder where the original image will be copied to. |
| iLinkObject | specifies the pageitem of the original image. |
| sessionToken | identifies the export session that owns the resulting file |
| useOriginalImageNameOnly | [IN] whether to add any prefix or suffix to original image name (eg "_opt"). |
| desiredWidth | [IN] if non-zero and less than or equal to the original image width, resample the image uniformly such that its target width matches this given width. |
| pure virtual |
WriteDocumentHeader used to be XMLExportProvider::ExportDocumentHeader(). It takes IXMLExportOptions and a rootName and generates a document header using IXMLExportOptions's GetDTD(), GetFPI(), GetStyleSheet(), and GetComments().
| xmlStream | is the stream the document header will be written out to. |
| exportOptions | provides GetDTD(), GetFPI(), GetStyleSheet(), and GetComments() for the document header. |
| rootName | is being used for root name of the root element (e.g. article) for IXMLOutStream::DocType. |