Perfectly Clear SDK Documentation  10.7.1.1191
PFCPDFImageIterator Class Reference

PFCPDFImageIterator allows the user to iterate over the PFC-supported images of a PDF file. It returns images to edit as necesary and will automatically embed them to the document again. If your PDF files could be password protected use podofo directly to open the document and then pass the open document to the iterator. More...

#include <PFCPDFImageIterator.h>

Public Member Functions

void setExpandImageData (bool expand)
 Sets if the PFCPDFImageFile should expand the pdf bytes into a PFCImageFile. More...
 
bool expandImageData ()
 Get if the PFCPDFImageFile should expand the pdf bytes into a PFCImageFile. More...
 
Accessing PdfMemDocument directly

For less common applications, it might be necessary to access to the PdfMemDocument directly. These functions allow that

PoDoFo::PdfMemDocument * document ()
 For more advanced usage this will point to the underlaying PDF documennt the iterator is modifying. More...
 
PoDoFo::PdfMemDocument * takeDocument ()
 For more advanced usage releases the document to the user and will no longer be managed by PFCPDFImageIterator. The returned document must outlive any PFCPDFImage images. More...
 

Main PDF Functions

Most implementations will use only these functions

enum  LoadStatus
 Status report from loading a PDF file with the load() function. More...
 
enum  SaveStatus
 Status report from saving a PDF file with the save() function. More...
 
 PFCPDFImageIterator (PoDoFo::PdfMemDocument *document)
 Iterates over PFC-compatible images from the given document. More...
 
 ~PFCPDFImageIterator ()
 Destroys the pointed document if it was created by this class.
 
LoadStatus load (const char *path)
 load() loads the file and returns true if succesful. More...
 
SaveStatus save (const char *path)
 save() loads the file and returns true if succesful. More...
 
PFCPDFImagenextImage ()
 Primary use of the iterator. It'll return a pointer to a PFCPDFImage until the document containes no more images when it'll return nullptr. More...
 

Detailed Description

PFCPDFImageIterator allows the user to iterate over the PFC-supported images of a PDF file. It returns images to edit as necesary and will automatically embed them to the document again. If your PDF files could be password protected use podofo directly to open the document and then pass the open document to the iterator.

Definition at line 28 of file PFCPDFImageIterator.h.

Member Function Documentation

◆ document()

PoDoFo::PdfMemDocument* document ( )

For more advanced usage this will point to the underlaying PDF documennt the iterator is modifying.

Returns
PdfMemDocument

◆ expandImageData()

bool expandImageData ( )

Get if the PFCPDFImageFile should expand the pdf bytes into a PFCImageFile.

Returns
true if should expand

◆ load()

LoadStatus load ( const char *  path)

load() loads the file and returns true if succesful.

Parameters
path[in] Path to PDF file to open
Returns
LoadStatus

◆ nextImage()

PFCPDFImage* nextImage ( )

Primary use of the iterator. It'll return a pointer to a PFCPDFImage until the document containes no more images when it'll return nullptr.

Returns
PDFImageFile PDFImageFile is managed by this class and it's deleted on calling this method again. Do not keep a reference to it beyond iterating.

◆ save()

SaveStatus save ( const char *  path)

save() loads the file and returns true if succesful.

Parameters
path[in] Path to PDF file to write
Returns
SaveStatus

◆ setExpandImageData()

void setExpandImageData ( bool  expand)

Sets if the PFCPDFImageFile should expand the pdf bytes into a PFCImageFile.

Parameters
expand[in] should expand or not

◆ takeDocument()

PoDoFo::PdfMemDocument* takeDocument ( )

For more advanced usage releases the document to the user and will no longer be managed by PFCPDFImageIterator. The returned document must outlive any PFCPDFImage images.

Returns
PdfMemDocument

Member Enumeration Documentation

◆ LoadStatus

enum LoadStatus
strong

Status report from loading a PDF file with the load() function.

Enumerator
Ok 

Success, file opened successfully.

FileNotFound 

File Not Found: could not find and open the file.

InvalidPassword 

PDF file is password protected and cannot be opened.

DocumentError 

Other error preventing proper file access.

Definition at line 47 of file PFCPDFImageIterator.h.

◆ SaveStatus

enum SaveStatus
strong

Status report from saving a PDF file with the save() function.

Enumerator
Ok 

Success, file saved successfully.

InvalidPath 

Could not create the path to save the PDF file.

DocumentError 

Other error preventing proper file writing.

Definition at line 63 of file PFCPDFImageIterator.h.

Constructor & Destructor Documentation

◆ PFCPDFImageIterator()

PFCPDFImageIterator ( PoDoFo::PdfMemDocument *  document)

Iterates over PFC-compatible images from the given document.

Parameters
document[in|out] does not take ownership of the pointer but the document muts outlive the iterator.

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