InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SnpExportBookAsPDF Class Reference

Public Member Functions

 SnpExportBookAsPDF ()
 
virtual ~SnpExportBookAsPDF ()
 
ErrorCode ExportBookAsPDF (IBook *book, IDFile &pdfFileName, UIDList &bookContentsToExport, bool16 exportAllDocsInBook=kTrue, IBookOutputActionCmdData::OutputUIOptions options=IBookOutputActionCmdData::kSuppressEverything)
 
const IDFile MakePDFFilename (IBook *book)
 
ErrorCode SetPDFExportStyleByIndex (int32 pdfStylesIndex)
 
K2Vector< PMStringGetBookNames (IBookManager *bookManager)
 
K2Vector< PMStringGetBookContentNames (IBookContentMgr *bookContentMgr)
 
K2Vector< PMStringGetPDFExportStyles (void)
 
int32 GetCurrentPDFExportStyle (void)
 

Detailed Description

  • Exports a book to a PDF.

This snippet shows how to use the kBookExportActionCmdBoss to export a book in various ways to PDF. When you export to PDF, you can export all of the book contents, or specific book contents.

See Also
kBookExportActionCmdBoss
IBookOutputActionCmdData
IPDFExportPrefs
kSetPDFExportPrefsCmdBoss

Constructor & Destructor Documentation

SnpExportBookAsPDF::SnpExportBookAsPDF ()
inline

Constructor.

virtual SnpExportBookAsPDF::~SnpExportBookAsPDF ()
inlinevirtual

Destructor.

Member Function Documentation

ErrorCode SnpExportBookAsPDF::ExportBookAsPDF (IBookbook,
IDFilepdfFileName,
UIDListbookContentsToExport,
bool16 exportAllDocsInBook = kTrue,
IBookOutputActionCmdData::OutputUIOptions options = IBookOutputActionCmdData::kSuppressEverything 
)

Exports a book as PDF. This method wraps the kBookExportActionCmdBoss.

Parameters
bookIN The book to export.
pdfFileNameIN The IDFile to which you want to export.
bookContentsToExportIN UIDList containing the specific book contents to export. This is ignored if exportAllDocsInBook is kTrue.
exportAllDocsInBookIN A flag to specify if you want all of the book content to be exported. Default: kTrue.
optionsIN UI Options for the operation. By default, this is set to IBookOutputActionCmdData::kSuppressEverything, which will not show any dialog. Refer to the comments in the Run() method for more details on how to change the PDF Export preferences programmatically.
Returns
kSuccess on success, other ErrorCode otherwise.
See Also
IBookOutputActionCmdData::OutputUIOptions
IBook
IBookManager
IBookContentMgr
K2Vector< PMString > SnpExportBookAsPDF::GetBookContentNames (IBookContentMgrbookContentMgr)

Gets the names of contents in a book.

Parameters
bookContentMgrIN The book's content manager.
Returns
A list of PMStrings containing names of contents (documents) in the book.
K2Vector< PMString > SnpExportBookAsPDF::GetBookNames (IBookManagerbookManager)

Gets the names of books currently available.

Parameters
bookManagerIN The session's book manager.
Returns
A list of PMStrings containing names of books that are currently open.
int32 SnpExportBookAsPDF::GetCurrentPDFExportStyle (void )

Returns the index of the current PDF export style

Returns
The index of the current PDF export style. This index is from the IGenStlEdtListMgr/IPDFExptStyleListMgr styles that are for exporting.
K2Vector< PMString > SnpExportBookAsPDF::GetPDFExportStyles (void )

Gets the names of PDF export styles.

Returns
List of PDF export styles by their names.
const IDFile SnpExportBookAsPDF::MakePDFFilename (IBookbook)

Makes a PDF filename (IDFile) for the book, based on the book's filename. It just replaces the .indb with .pdf.

Parameters
bookIN The book that you want to export.
Returns
IDFile for the PDF to export.
See Also
SDKFileHelper
ErrorCode SnpExportBookAsPDF::SetPDFExportStyleByIndex (int32 pdfStylesIndex)

Sets the PDF export style by index.

Parameters
pdfStylesIndexIN The index of the IGenStlEdtListMgr/IPDFExptStyleListMgr styles. Note that all import and export styles are grouped together.
Returns
kSuccess if success, kFailure otherwise.