Mako 7.5.0 API
Loading...
Searching...
No Matches
JawsMako::IPDFInput Class Referenceabstract

An instance of the JawsMako PDF input class. More...

#include <pdfinput.h>

Inheritance diagram for JawsMako::IPDFInput:

Classes

class  CPdfFontInfo
 Information about a font in a PDF file, obtained by scanning the PDF font structures. More...
 
class  CPdfScannedInk
 Basic information about an ink used in a PDF file, obtained by scanning the PDF page tree. More...
 

Public Member Functions

virtual void setPassword (const U8String &password)=0
 Set the password that should be used when attempting to open PDF files. For password encrypted PDF, this is the user or owner password. For PDF files encrypted with public key cryptography, this is the password to be used to extract the private key from the PKCS12/PFX container. The default is no password.
 
virtual void setPkcs12 (const IRAInputStreamPtr &pkcs12)=0
 Set the stream containing the PKCS12/PFX data containing the private key used to decrypt the PDF when public key encryption is used.
 
virtual void setFailOnFontFallback (bool failOnFontFallback)=0
 Set whether or not to fail when a font cannot be found and PDF input needs to use a fallback font or create and emulated font.
 
virtual void setImproveGlyphSelectionForUnembeddedIdentityFonts (bool improve)=0
 Set whether or not to attempt to improve glyph selection for non- embedded Identity CIDFonts.
 
virtual void setDefaultRenderingIntent (eRenderingIntent intent)=0
 Override the default rendering intent in the PDF.
 
virtual CPdfFontInfoVect scanPdfForFonts (const U8String &pathToFile, const IProgressMonitorPtr &progressMonitor, bool domFont=false)=0
 Quickly scan the PDF file at the given UTF-8 path for fonts. Does not attempt to validate the fonts, nor use them in any way. Instead, the PDF page tree is scanned and the PDF font objects interrogated. Annotations are scanned also.
 
virtual CPdfFontInfoVect scanPdfForFonts (const String &pathToFile, const IProgressMonitorPtr &progressMonitor, bool domFont=false)=0
 Quickly scan the PDF file at the given wide-character Unicode path for fonts. Does not attempt to validate the fonts, nor use them in any way. Instead, the PDF page tree is scanned and the PDF font objects interrogated. Annotations are scanned also.
 
virtual CPdfFontInfoVect scanPdfForFonts (const IInputStreamPtr &pdfStream, const IProgressMonitorPtr &progressMonitor, bool domFont=false)=0
 Quickly scan the PDF file in the given stream for fonts. Does not attempt to validate the fonts, nor use them in any way. Instead, the PDF page tree is scanned and the PDF font objects interrogated. Annotations are scanned also.
 
virtual CPdfScannedInkVect scanPdfForInks (const U8String &pathToFile, const IProgressMonitorPtr &progressMonitor, uint32 startPageIndex=0, uint32 endPageIndex=0)=0
 Quickly scan the PDF file at the given UTF-8 path and find any mentions of inks in color spaces.
 
virtual CPdfScannedInkVect scanPdfForInks (const String &pathToFile, const IProgressMonitorPtr &progressMonitor, uint32 startPageIndex=0, uint32 endPageIndex=0)=0
 Quickly scan the PDF file at the given wide character path and find any mentions of inks in color spaces.
 
virtual CPdfScannedInkVect scanPdfForInks (const IInputStreamPtr &pdfStream, const IProgressMonitorPtr &progressMonitor, uint32 startPageIndex=0, uint32 endPageIndex=0)=0
 Quickly scan the given PDF stream and find any mentions of inks in color spaces.
 
virtual uint32 getNumIncrementalSaves (const U8String &pathToFile)=0
 Find the number of incremental saves in the given PDF stream.
 
virtual uint32 getNumIncrementalSaves (const String &pathToFile)=0
 Find the number of incremental saves in the given PDF stream.
 
virtual uint32 getNumIncrementalSaves (const IInputStreamPtr &pdfStream)=0
 Find the number of incremental saves in the given PDF stream.
 
virtual IDocumentAssemblyPtr openIncremental (const U8String &pathToFile, uint32 incrementalIndex)=0
 Open an incremental PDF stream, returning the IDocumentAssembly representing the contents.
 
virtual IDocumentAssemblyPtr openIncremental (const String &pathToFile, uint32 incrementalIndex)=0
 Open an incremental PDF stream, returning the IDocumentAssembly representing the contents.
 
virtual IDocumentAssemblyPtr openIncremental (const IInputStreamPtr &pdfStream, uint32 incrementalIndex)=0
 Open an incremental PDF stream, returning the IDocumentAssembly representing the contents.
 
virtual CIRAInputStreamVect getIncrementalSaves (const U8String &pathToFile)=0
 Find the number of incremental saves in the given PDF stream, returning a vector of streams.
 
virtual CIRAInputStreamVect getIncrementalSaves (const String &pathToFile)=0
 Find the number of incremental saves in the given PDF stream, returning a vector of streams.
 
virtual CIRAInputStreamVect getIncrementalSaves (const IInputStreamPtr &pdfStream)=0
 Find the number of incremental saves in the given PDF stream, returning a vector of streams.
 
virtual void setAlternateBaseFont (const U8String &baseFontName, const U8String &alternateFontName)=0
 Set an alternate base font for cases when the built-in font may not be suitable.
 
- Public Member Functions inherited from JawsMako::IInput
virtual IDocumentAssemblyPtr open (const U8String &pathToFile)=0
 Open a file on disk, returning the IDocumentAssembly representing the contents.
 
virtual IDocumentAssemblyPtr open (const String &pathToFile)=0
 Open a file on disk, returning the IDocumentAssembly representing the contents. Takes a wide character string.
 
virtual IDocumentAssemblyPtr open (const IInputStreamPtr &inputStream)=0
 Open a stream, returning the IDocumentAssembly representing the contents.
 
virtual void setSequentialMode (bool sequential)=0
 Set/unset sequential mode on this input.
 
virtual void setParameter (const U8String &param, const U8String &value)=0
 Apply a key value pair output parameter with a string value. The parameter name is case insensitive. Please refer to the supplied documentation for the details of the available parameters and their ranges.
 
- Public Member Functions inherited from IRCObject
virtual void addRef () const =0
 Increases the reference count of the actual object pointed to. This would take place during an assignment or copying.
 
virtual bool decRef () const =0
 Decreases the reference count of the actual object pointed to. When the reference count falls to Zero, it deletes the actual object pointed to.
 
virtual int32 getRefCount () const =0
 Retrieve the current reference count of the actual object pointed to.
 

Static Public Member Functions

static JAWSMAKO_API IPDFInputPtr create (const IJawsMakoPtr &jawsMako, const IProgressMonitorPtr &progressMonitor=IProgressMonitorPtr())
 Create an input for reading source documents in PDF format.
 
- Static Public Member Functions inherited from JawsMako::IInput
static JAWSMAKO_API IInputPtr create (const IJawsMakoPtr &jawsMako, eFileFormat format, const IProgressMonitorPtr &progressMonitor=IProgressMonitorPtr())
 Create an input for reading source documents in the given format. The following formats are currently supported:
 

Additional Inherited Members

- Protected Member Functions inherited from IRCObject
virtual ~IRCObject ()
 Virtual destructor.
 

Detailed Description

An instance of the JawsMako PDF input class.

Member Function Documentation

◆ create()

static JAWSMAKO_API IPDFInputPtr JawsMako::IPDFInput::create ( const IJawsMakoPtr & jawsMako,
const IProgressMonitorPtr & progressMonitor = IProgressMonitorPtr() )
static

Create an input for reading source documents in PDF format.

Parameters
jawsMakoThe IJawsMako object
progressMonitorA smart pointer to an IProgressMonitor object which can be NULL if no such object was passed in.
Returns
IPDFInputPtr the PDF input

◆ getIncrementalSaves() [1/3]

virtual CIRAInputStreamVect JawsMako::IPDFInput::getIncrementalSaves ( const IInputStreamPtr & pdfStream)
pure virtual

Find the number of incremental saves in the given PDF stream, returning a vector of streams.

Parameters
pdfStreamThe input PDF stream.
Returns
CIRAInputStreamVect A vector of incremental PDF streams, which will be zero length for PDF files saved without incremental update. Returned streams are not copied from the input, but are created from the input with createSubFile() and offset to the end of each incremental save.

◆ getIncrementalSaves() [2/3]

virtual CIRAInputStreamVect JawsMako::IPDFInput::getIncrementalSaves ( const String & pathToFile)
pure virtual

Find the number of incremental saves in the given PDF stream, returning a vector of streams.

Parameters
pathToFileThe path to the input file.
Returns
CIRAInputStreamVect A vector of incremental PDF streams, which will be zero length for PDF files saved without incremental update. Returned streams are not copied from the input, but are created from the input with createSubFile() and offset to the end of each incremental save.

◆ getIncrementalSaves() [3/3]

virtual CIRAInputStreamVect JawsMako::IPDFInput::getIncrementalSaves ( const U8String & pathToFile)
pure virtual

Find the number of incremental saves in the given PDF stream, returning a vector of streams.

Parameters
pathToFileThe path to the input file.
Returns
CIRAInputStreamVect A vector of incremental PDF streams, which will be zero length for PDF files saved without incremental update. Returned streams are not copied from the input, but are created from the input with createSubFile() and offset to the end of each incremental save.

◆ getNumIncrementalSaves() [1/3]

virtual uint32 JawsMako::IPDFInput::getNumIncrementalSaves ( const IInputStreamPtr & pdfStream)
pure virtual

Find the number of incremental saves in the given PDF stream.

Parameters
pdfStreamThe input PDF stream.
Returns
uint32 The number of incremental saves in the PDF stream. Returns a value of zero for PDF files saved without incremental update.

◆ getNumIncrementalSaves() [2/3]

virtual uint32 JawsMako::IPDFInput::getNumIncrementalSaves ( const String & pathToFile)
pure virtual

Find the number of incremental saves in the given PDF stream.

Parameters
pathToFileThe path to the input file.
Returns
uint32 The number of incremental saves in the PDF stream. Returns a value of zero for PDF files saved without incremental update.

◆ getNumIncrementalSaves() [3/3]

virtual uint32 JawsMako::IPDFInput::getNumIncrementalSaves ( const U8String & pathToFile)
pure virtual

Find the number of incremental saves in the given PDF stream.

Parameters
pathToFileThe path to the input file.
Returns
uint32 The number of incremental saves in the PDF stream. Returns a value of zero for PDF files saved without incremental update.

◆ openIncremental() [1/3]

virtual IDocumentAssemblyPtr JawsMako::IPDFInput::openIncremental ( const IInputStreamPtr & pdfStream,
uint32 incrementalIndex )
pure virtual

Open an incremental PDF stream, returning the IDocumentAssembly representing the contents.

Parameters
pdfStreamThe input PDF stream.
incrementalUpdateIndexThe incremental update to load, with valid values being in the range 0 to getNumIncrementalSaves().
Returns
IDocumentAssemblyPtr The document assembly.

◆ openIncremental() [2/3]

virtual IDocumentAssemblyPtr JawsMako::IPDFInput::openIncremental ( const String & pathToFile,
uint32 incrementalIndex )
pure virtual

Open an incremental PDF stream, returning the IDocumentAssembly representing the contents.

Parameters
pathToFileThe path to the input file.
incrementalUpdateIndexThe incremental update to load, with valid values being in the range 0 to getNumIncrementalSaves().
Returns
IDocumentAssemblyPtr The document assembly.

◆ openIncremental() [3/3]

virtual IDocumentAssemblyPtr JawsMako::IPDFInput::openIncremental ( const U8String & pathToFile,
uint32 incrementalIndex )
pure virtual

Open an incremental PDF stream, returning the IDocumentAssembly representing the contents.

Parameters
pathToFileThe path to the input file.
incrementalUpdateIndexThe incremental update to load, with valid values being in the range 0 to getNumIncrementalSaves().
Returns
IDocumentAssemblyPtr The document assembly.

◆ scanPdfForFonts() [1/3]

virtual CPdfFontInfoVect JawsMako::IPDFInput::scanPdfForFonts ( const IInputStreamPtr & pdfStream,
const IProgressMonitorPtr & progressMonitor,
bool domFont = false )
pure virtual

Quickly scan the PDF file in the given stream for fonts. Does not attempt to validate the fonts, nor use them in any way. Instead, the PDF page tree is scanned and the PDF font objects interrogated. Annotations are scanned also.

You can pass in an optional callback function to receive progress information. From this function, execution may be aborted by throwing an abort exception using throwEDLError(EDL_ERR_ABORTED) which will propagate back to the caller.

When the optional domFont parameter is set to true, scanPdfFonts() will generate a IDOMFont from any found PDF font object.

Note: Even if a font is embedded, a given PDF consumer may decide not to use it and instead use a substitute, for example if the font is invalid or broken.

◆ scanPdfForFonts() [2/3]

virtual CPdfFontInfoVect JawsMako::IPDFInput::scanPdfForFonts ( const String & pathToFile,
const IProgressMonitorPtr & progressMonitor,
bool domFont = false )
pure virtual

Quickly scan the PDF file at the given wide-character Unicode path for fonts. Does not attempt to validate the fonts, nor use them in any way. Instead, the PDF page tree is scanned and the PDF font objects interrogated. Annotations are scanned also.

You can pass in an optional callback function to receive progress information. From this function, execution may be aborted by throwing an abort exception using throwEDLError(EDL_ERR_ABORTED) which will propagate back to the caller.

When the optional domFont parameter is set to true, scanPdfFonts() will generate a IDOMFont from any found PDF font object.

Note: Even if a font is embedded, a given PDF consumer may decide not to use it and instead use a substitute, for example if the font is invalid or broken.

◆ scanPdfForFonts() [3/3]

virtual CPdfFontInfoVect JawsMako::IPDFInput::scanPdfForFonts ( const U8String & pathToFile,
const IProgressMonitorPtr & progressMonitor,
bool domFont = false )
pure virtual

Quickly scan the PDF file at the given UTF-8 path for fonts. Does not attempt to validate the fonts, nor use them in any way. Instead, the PDF page tree is scanned and the PDF font objects interrogated. Annotations are scanned also.

You can pass in an optional callback function to receive progress information. From this function, execution may be aborted by throwing an abort exception using throwEDLError(EDL_ERR_ABORTED) which will propagate back to the caller.

When the optional domFont parameter is set to true, scanPdfFonts() will generate a IDOMFont from any found PDF font object.

Note: Even if a font is embedded, a given PDF consumer may decide not to use it and instead use a substitute, for example if the font is invalid or broken.

◆ scanPdfForInks() [1/3]

virtual CPdfScannedInkVect JawsMako::IPDFInput::scanPdfForInks ( const IInputStreamPtr & pdfStream,
const IProgressMonitorPtr & progressMonitor,
uint32 startPageIndex = 0,
uint32 endPageIndex = 0 )
pure virtual

Quickly scan the given PDF stream and find any mentions of inks in color spaces.

Parameters
pdfStreamThe input PDF stream to scan.
progressMonitorA smart pointer to an IProgressMonitor object which can be NULL if no such object was passed in.
startPageIndexOptional index of the first page to scan. Pages are numbered starting with page 0, which is the default value.
endPageIndexOptional index of the end page. This is the index after the last page, where the number of pages to scan is equal to (endPageIndex - startPageIndex). Setting this parameter to 0 indicates that the function should scan up to and including the final page.

◆ scanPdfForInks() [2/3]

virtual CPdfScannedInkVect JawsMako::IPDFInput::scanPdfForInks ( const String & pathToFile,
const IProgressMonitorPtr & progressMonitor,
uint32 startPageIndex = 0,
uint32 endPageIndex = 0 )
pure virtual

Quickly scan the PDF file at the given wide character path and find any mentions of inks in color spaces.

Parameters
pathToFileThe path to the input file to scan.
progressMonitorA smart pointer to an IProgressMonitor object which can be NULL if no such object was passed in.
startPageIndexOptional index of the first page to scan. Pages are numbered starting with page 0, which is the default value.
endPageIndexOptional index of the end page. This is the index after the last page, where the number of pages to scan is equal to (endPageIndex - startPageIndex). Setting this parameter to 0 indicates that the function should scan up to and including the final page.

◆ scanPdfForInks() [3/3]

virtual CPdfScannedInkVect JawsMako::IPDFInput::scanPdfForInks ( const U8String & pathToFile,
const IProgressMonitorPtr & progressMonitor,
uint32 startPageIndex = 0,
uint32 endPageIndex = 0 )
pure virtual

Quickly scan the PDF file at the given UTF-8 path and find any mentions of inks in color spaces.

Parameters
pathToFileThe path to the input file to scan.
progressMonitorA smart pointer to an IProgressMonitor object which can be NULL if no such object was passed in.
startPageIndexOptional index of the first page to scan. Pages are numbered starting with page 0, which is the default value.
endPageIndexOptional index of the end page. This is the index after the last page, where the number of pages to scan is equal to (endPageIndex - startPageIndex). Setting this parameter to 0 indicates that the function should scan up to and including the final page.

◆ setAlternateBaseFont()

virtual void JawsMako::IPDFInput::setAlternateBaseFont ( const U8String & baseFontName,
const U8String & alternateFontName )
pure virtual

Set an alternate base font for cases when the built-in font may not be suitable.

This function can be used to set the name of a system font that may be used in place of one of the base PDF fonts. Some poorly constructed PDF files attempt define encodings for non-embedded base fonts (e.g Helvetica) with character names that are not present in the Adobe standard Latin character set, and are not available when using Mako's base fonts, but may be present in a system font.

Setting an alternate font name indicates that Mako should substitute a non-embedded Base 35 font with a system font when the PDF encoding defines character names outside of the Adobe standard Latin character set.

Parameters
baseFontNameThe name of a Base 35 font to substitute. Must be a non-symbolic font.
alternateFontNameThe name of a system font to use as a substitute, which must be the name of a system font that can be found with IJawsMako::findFont().

◆ setDefaultRenderingIntent()

virtual void JawsMako::IPDFInput::setDefaultRenderingIntent ( eRenderingIntent intent)
pure virtual

Override the default rendering intent in the PDF.

      The default is RelativeColorimetric, as per the PDF specification.

◆ setFailOnFontFallback()

virtual void JawsMako::IPDFInput::setFailOnFontFallback ( bool failOnFontFallback)
pure virtual

Set whether or not to fail when a font cannot be found and PDF input needs to use a fallback font or create and emulated font.

If false, font substitution and/or font emulation for missing fonts is allowed, which is sensible behaviour for general use cases. If a font is found to be invalid, a font may be sought on the users system or substituted.

If true, PDF input will fail and an exception thrown if a font requires the use of a fallback font or an emulated font, or if a damaged font is found and needs to be substituted.

The default is false.

◆ setImproveGlyphSelectionForUnembeddedIdentityFonts()

virtual void JawsMako::IPDFInput::setImproveGlyphSelectionForUnembeddedIdentityFonts ( bool improve)
pure virtual

Set whether or not to attempt to improve glyph selection for non- embedded Identity CIDFonts.

Such fonts are encoded such that glyphs are directly selected by mapping character codes to glyph IDs. Jobs that reference such fonts will only work correctly if the font that is used stores the used characters using the same glyph IDs. This is true if the exact same font is present on the users system as the system where the job was generated. It may work for different versions of the same font, or cases where by convention the same glyphs slots are used.

There are no guarantees that this will be the case in general.

To attempt to improve the situation, Mako will attempt to use other clues to better select glyphs, if this feature is enabled and can oftentimes produce a legible result where disparate fonts are used.

However doing this can disrupt cases where the intent is to write the result to PDF output without the fonts embedded. Here it is necessary to use the same glyph slots regardless of what is stored in them. If IPDFOutput::setEmbedIdentityCidFonts(false) is to be used, then this feature should be disabled also.

The default is true.

◆ setPassword()

virtual void JawsMako::IPDFInput::setPassword ( const U8String & password)
pure virtual

Set the password that should be used when attempting to open PDF files. For password encrypted PDF, this is the user or owner password. For PDF files encrypted with public key cryptography, this is the password to be used to extract the private key from the PKCS12/PFX container. The default is no password.

Parameters
passwordThe password to use. Assumed to be UTF8.

◆ setPkcs12()

virtual void JawsMako::IPDFInput::setPkcs12 ( const IRAInputStreamPtr & pkcs12)
pure virtual

Set the stream containing the PKCS12/PFX data containing the private key used to decrypt the PDF when public key encryption is used.

Note: Public Key Encryption is only supported on Linux and Windows (non-UWP) platforms at this time.

Parameters
pkcs12A random access stream pointing to a pkcs12/pfx file for the user that is authorised as a recipient for this PDF.

The documentation for this class was generated from the following file: