Word.DocumentExportAsFixedFormatOptions interface
Note
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Provides configuration options for the Document.exportAsFixedFormat method.
Remarks
[ API set: WordApi BETA (PREVIEW ONLY) ]
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/export.yaml
await Word.run(async (context) => {
const document: Word.Document = context.document;
// Export the current document as a PDF saved in your default location, usually Documents.
const filename = `exported-doc-${getCurrentDate()}.pdf`;
console.log(`File name: ${filename}`);
const options: Word.DocumentExportAsFixedFormatOptions = {
item: Word.ExportItem.documentContent,
openAfterExport: true,
};
// If a file with the same name already exists at the default location, it's silently overwritten.
document.exportAsFixedFormat(filename, Word.ExportFormat.pdf, options);
await context.sync();
});
Properties
| bitmap |
If provided, specifies whether to bitmap missing fonts. The default value is |
| create |
If provided, specifies the bookmark creation mode. The default value is |
| document |
If provided, specifies whether to include document structure tags. The default value is |
| fixed |
If provided, specifies the extension class pointer. The default value is |
| from | If provided, specifies the starting page number. The default value is |
| include |
If provided, specifies whether to include document properties. The default value is |
| item | If provided, specifies the item to export. The default value is |
| keep |
If provided, specifies whether to keep Information Rights Management (IRM) settings. The default value is |
| open |
If provided, specifies whether to open the file after export. The default value is |
| optimize |
If provided, specifies the optimization target for the export. The default value is |
| range | If provided, specifies the range to export. The default value is |
| to | If provided, specifies the ending page number. The default value is the last page of the document. |
| use |
If provided, specifies whether to use ISO 19005-1 compliance. The default value is |
Property Details
bitmapMissingFonts
Note
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
If provided, specifies whether to bitmap missing fonts. The default value is true.
bitmapMissingFonts?: boolean;
Property Value
boolean
Remarks
createBookmarks
Note
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
If provided, specifies the bookmark creation mode. The default value is none.
createBookmarks?: Word.ExportCreateBookmarks | "None" | "Headings" | "WordBookmarks";
Property Value
Word.ExportCreateBookmarks | "None" | "Headings" | "WordBookmarks"
Remarks
documentStructureTags
Note
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
If provided, specifies whether to include document structure tags. The default value is true.
documentStructureTags?: boolean;
Property Value
boolean
Remarks
fixedFormatExtensionClassPointer
Note
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
If provided, specifies the extension class pointer. The default value is null.
fixedFormatExtensionClassPointer?: any;
Property Value
any
Remarks
from
Note
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
If provided, specifies the starting page number. The default value is 1.
from?: number;
Property Value
number
Remarks
includeDocProps
Note
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
If provided, specifies whether to include document properties. The default value is true.
includeDocProps?: boolean;
Property Value
boolean
Remarks
item
Note
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
If provided, specifies the item to export. The default value is documentContent.
item?: Word.ExportItem | "DocumentContent" | "DocumentWithMarkup";
Property Value
Word.ExportItem | "DocumentContent" | "DocumentWithMarkup"
Remarks
keepInformationRightsManagement
Note
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
If provided, specifies whether to keep Information Rights Management (IRM) settings. The default value is true.
keepInformationRightsManagement?: boolean;
Property Value
boolean
Remarks
openAfterExport
Note
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
If provided, specifies whether to open the file after export. The default value is false.
openAfterExport?: boolean;
Property Value
boolean
Remarks
optimizeFor
Note
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
If provided, specifies the optimization target for the export. The default value is print.
optimizeFor?: Word.ExportOptimizeFor | "Print" | "OnScreen";
Property Value
Word.ExportOptimizeFor | "Print" | "OnScreen"
Remarks
range
Note
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
If provided, specifies the range to export. The default value is allDocument.
range?: Word.ExportRange | "AllDocument" | "Selection" | "CurrentPage" | "FromTo";
Property Value
Word.ExportRange | "AllDocument" | "Selection" | "CurrentPage" | "FromTo"
Remarks
to
Note
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
If provided, specifies the ending page number. The default value is the last page of the document.
to?: number;
Property Value
number
Remarks
useIso19005_1
Note
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
If provided, specifies whether to use ISO 19005-1 compliance. The default value is false.
useIso19005_1?: boolean;
Property Value
boolean