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

Public Member Functions

 SnpCreateInddPreview ()
 
virtual ~SnpCreateInddPreview ()
 
ErrorCode CreateFirstPagePreview (const UIDRef &docRef, const bool16 &faceless, const IDFile &jpegFile, const PMReal &xScale=1.0, const PMReal &yScale=1.0, const PMReal &desiredRes=36.0)
 

Detailed Description

  • How to take a preview JPEG of an InDesign document

This snippet class uses SnapshotUtils to make a preview of the 1st page of an InDesign document. If there is a front document, it is used to create the preview, otherwise, user will be prompted to select a file, which will be open faceless.

Constructor & Destructor Documentation

SnpCreateInddPreview::SnpCreateInddPreview ()
inline

Constructor.

virtual SnpCreateInddPreview::~SnpCreateInddPreview ()
inlinevirtual

Destructor. Cleans up the internal SnapshotUtils member.

Member Function Documentation

ErrorCode SnpCreateInddPreview::CreateFirstPagePreview (const UIDRefdocRef,
const bool16 & faceless,
const IDFilejpegFile,
const PMRealxScale = 1.0,
const PMRealyScale = 1.0,
const PMRealdesiredRes = 36.0 
)

Creates the preview of the first page of a document, and immediately saves it to a JPEG format file.

Parameters
docRefIN UIDRef for the document to preview.
facelessIN bool16 if the document is opened via a choose file dialog, it is not displayed in layout window.
jpegFileIN IDFile for the JPEG file to save.
xScaleIN Scale in the X-direction. Default = 1.0 (=100%)
yScaleIN Scale in the Y-direction. Default = 1.0 (=100%)
desiredResIN Desired resolution. Default = 36.0.
Returns
kSuccess on success, kFailure otherwise.