NDEVR
API Documentation

Writes to a PDF file using the IOFactory interface. More...

Inheritance diagram for PDFFactory:
[legend]
Collaboration diagram for PDFFactory:
[legend]

Public Member Functions

 PDFFactory ()
 Constructs the PDFFactory.
virtual bool canRead (const FactoryParameters &file) override
 Checks whether the given parameters describe a readable PDF.
virtual bool canWrite (const FactoryParameters &file) override
 Checks whether the given parameters describe a writable PDF.
virtual bool canWrite (const File &file) override
 Checks whether the given file can be written as PDF.
virtual bool canWrite (const FileFormat &file) override
 Checks whether the given format is writable.
FactoryOptions defaultWriteOptions (const FactoryParameters &file) const override
 Returns the default write options for PDF export.
FactoryFeatures factoryFeatures (const FactoryParameters &file, bool is_import) const override
 Returns the supported factory features for the given file.
virtual void getSupportedFormats (Buffer< FileFormat > &formats, bool is_read) override
 Populates the list of supported PDF file formats.
virtual void getSupportedFormats (Buffer< FileFormat > &formats, DesignObjectLookup *lookup, const Buffer< UUID > &models) override
 Populates supported formats filtered by model context.
virtual bool readFile (FactoryParameters &file) override
 Reads a PDF file into the design model.
virtual void setdpi (fltp08 dpi)
 Sets the output resolution in dots per inch.
void setDrawBorder (bool border)
 Enables or disables drawing a page border.
void setDrawGrid (bool draw_grid)
 Enables or disables drawing a grid in the PDF output.
void setMargins (uint04 margins)
 Sets the page margins in points.
void setTitle (const String &title, const String &subject)
 Sets the title and subject metadata for the PDF.
virtual bool writeFile (const FactoryParameters &file, const DesignObjectLookup *lookup, const Buffer< UUID > &objects_to_write, const Buffer< UUID > &cameras, const FactoryOptions &options)
 Writes specific objects and camera views to a PDF file.
virtual bool writeFile (FactoryParameters &file) override
 Writes design data to a PDF file.
Public Member Functions inherited from IOFactory
 IOFactory (const StringView &factory_name)
 Constructs an IOFactory with the given factory name.
virtual ~IOFactory ()
 Virtual destructor.
virtual bool canRead (const File &file)
 Checks whether this factory can read the given file.
virtual bool canRead (const FileFormat &file)
 Checks whether this factory can read the given file format.
virtual FactoryOptions defaultReadOptions (const FactoryParameters &file) const
 Returns the default read options for the given factory parameters.
virtual bool determineExtension (const File &file, String &extension)
 Attempts to determine the file extension for the given file.
String factoryReadAppFeature () const
 Returns the application feature string required for read operations.
String factoryWriteAppFeature () const
 Returns the application feature string required for write operations.
virtual Buffer< UUIDfilterModelsToExport (Buffer< UUID > models_to_check, const DesignObjectLookup *lookup, const FileFormat &export_format) const
 Filters a list of model UUIDs to only those that can be exported in the given format.
virtual String getIcon (const File &file)
 Returns the icon name associated with the given file type.
void getSupportedFormats (Buffer< FileFormat > &formats)
 Populates the given buffer with all supported file formats (both read and write).
virtual void getSupportedFormats (Buffer< FileFormat > &formats, const File &file)
 Populates the given buffer with formats supported for the specified file.
virtual void getSupportedFormatsByModelType (Buffer< FileFormat > &formats, bool is_read, const StringView &model_type)
 Populates the given buffer with formats matching a specific model type.
virtual void getSupportedFormatsForExtension (Buffer< FileFormat > &formats, bool is_read, const StringView &extension)
 Populates the given buffer with formats matching a specific file extension.
virtual bool isAutoEnabled () const
 Checks whether this factory is automatically enabled without requiring a password.
virtual bool isFactoryEnabled (bool is_read) const
 Checks whether this factory is enabled for reading or writing.
const Stringname () const
 Returns the name of this factory.
Buffer< UUIDreadFileWithDefaultSettings (const File &file, DesignObjectLookup *lookup)
 Reads a file using default settings and returns the UUIDs of the created models.
Buffer< ScenereadScenesFromFile (const File &file)
 Reads scenes from a file and returns them as a buffer of Scene objects.
void throwIfNotEnabled (bool is_read)
 Throws an exception if the factory is not enabled for the given operation direction.
virtual bool updateFromFile (const FactoryParameters &file, const FactoryOptions &old_options)
 Updates the factory parameters from a file, comparing against old options.
bool writeScenesToFile (const File &file, const Buffer< Scene > &scene)
 Writes a buffer of scenes to a file.

Static Public Member Functions

static constexpr StringView OptionsGroupName ()
 Returns the options group name used for PDF paper settings.
Static Public Member Functions inherited from IOFactory
static void EnableExtension (const StringView &extension, const StringView &read_password, const StringView &write_password)
 Enables a specific file extension with the given read and write passwords.
static void EnableFactory (const StringView &factory, const StringView &read_password, const StringView &write_password)
 Enables a factory by name with the given read and write passwords.
static void EnableFactory (IOFactory *factory, const StringView &read_password, const StringView &write_password)
 Registers an IOFactory instance with the system, enabling it for read and/or write.

Protected Attributes

fltp08 m_dpi
 The output resolution in dots per inch.
bool m_draw_border
 Whether to draw a page border.
bool m_draw_grid
 Whether to draw a grid overlay.
uint04 m_margins
 The page margins in points.
String m_subject
 The PDF document subject.
String m_title
 The PDF document title.

Detailed Description

Writes to a PDF file using the IOFactory interface.


Definition at line 45 of file PDFFactory.h.

Member Function Documentation

◆ canRead()

virtual bool PDFFactory::canRead ( const FactoryParameters & file)
overridevirtual

Checks whether the given parameters describe a readable PDF.

Parameters
[in]fileThe factory parameters.
Returns
True if readable.

Reimplemented from IOFactory.

◆ canWrite() [1/3]

virtual bool PDFFactory::canWrite ( const FactoryParameters & file)
overridevirtual

Checks whether the given parameters describe a writable PDF.

Parameters
[in]fileThe factory parameters.
Returns
True if writable.

Reimplemented from IOFactory.

◆ canWrite() [2/3]

virtual bool PDFFactory::canWrite ( const File & file)
overridevirtual

Checks whether the given file can be written as PDF.

Parameters
[in]fileThe file to check.
Returns
True if writable.

Reimplemented from IOFactory.

◆ canWrite() [3/3]

virtual bool PDFFactory::canWrite ( const FileFormat & file)
overridevirtual

Checks whether the given format is writable.

Parameters
[in]fileThe file format to check.
Returns
True if writable.

Reimplemented from IOFactory.

◆ defaultWriteOptions()

FactoryOptions PDFFactory::defaultWriteOptions ( const FactoryParameters & file) const
overridevirtual

Returns the default write options for PDF export.

Parameters
[in]fileThe factory parameters.
Returns
The default FactoryOptions for writing.

Reimplemented from IOFactory.

◆ factoryFeatures()

FactoryFeatures PDFFactory::factoryFeatures ( const FactoryParameters & file,
bool is_import ) const
overridevirtual

Returns the supported factory features for the given file.

Parameters
[in]fileThe factory parameters.
[in]is_importWhether features are for importing.
Returns
The FactoryFeatures descriptor.

Implements IOFactory.

◆ getSupportedFormats() [1/2]

virtual void PDFFactory::getSupportedFormats ( Buffer< FileFormat > & formats,
bool is_read )
overridevirtual

Populates the list of supported PDF file formats.

Parameters
[in]formatsThe buffer to populate.
[in]is_readWhether to list read formats (true) or write formats (false).

Implements IOFactory.

◆ getSupportedFormats() [2/2]

virtual void PDFFactory::getSupportedFormats ( Buffer< FileFormat > & formats,
DesignObjectLookup * lookup,
const Buffer< UUID > & models )
overridevirtual

Populates supported formats filtered by model context.

Parameters
[in]formatsThe buffer to populate.
[in]lookupThe design object lookup.
[in]modelsThe models to consider.

Reimplemented from IOFactory.

◆ OptionsGroupName()

constexpr StringView PDFFactory::OptionsGroupName ( )
inlinestaticconstexpr

Returns the options group name used for PDF paper settings.

Returns
The options group name string.

Definition at line 120 of file PDFFactory.h.

◆ readFile()

virtual bool PDFFactory::readFile ( FactoryParameters & file)
overridevirtual

Reads a PDF file into the design model.

Parameters
[in]fileThe factory parameters.
Returns
True on success.

Implements IOFactory.

◆ setdpi()

virtual void PDFFactory::setdpi ( fltp08 dpi)
virtual

Sets the output resolution in dots per inch.

Parameters
[in]dpiThe resolution value.

◆ setDrawBorder()

void PDFFactory::setDrawBorder ( bool border)

Enables or disables drawing a page border.

Parameters
[in]borderWhether to draw the border.

◆ setDrawGrid()

void PDFFactory::setDrawGrid ( bool draw_grid)

Enables or disables drawing a grid in the PDF output.

Parameters
[in]draw_gridWhether to draw the grid.

◆ setMargins()

void PDFFactory::setMargins ( uint04 margins)

Sets the page margins in points.

Parameters
[in]marginsThe margin size.

◆ setTitle()

void PDFFactory::setTitle ( const String & title,
const String & subject )

Sets the title and subject metadata for the PDF.

Parameters
[in]titleThe document title.
[in]subjectThe document subject.

◆ writeFile() [1/2]

virtual bool PDFFactory::writeFile ( const FactoryParameters & file,
const DesignObjectLookup * lookup,
const Buffer< UUID > & objects_to_write,
const Buffer< UUID > & cameras,
const FactoryOptions & options )
virtual

Writes specific objects and camera views to a PDF file.

Parameters
[in]fileThe factory parameters.
[in]lookupThe design object lookup.
[in]objects_to_writeThe UUIDs of objects to include.
[in]camerasThe UUIDs of camera views to render.
[in]optionsThe factory options.
Returns
True on success.

◆ writeFile() [2/2]

virtual bool PDFFactory::writeFile ( FactoryParameters & file)
overridevirtual

Writes design data to a PDF file.

Parameters
[in]fileThe factory parameters.
Returns
True on success.

Implements IOFactory.


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