Page Module

Detailed Description

group a3d_pdf_page_module

Module to define and access a Page in a document.

This module describes the functions and structures that allow you to define a PDF Page in the document.

Type Documentation

enum A3DPDFEPageSize

Page size of the PDF document.

Version
4.1

Values:

enumerator kA3DPDFPage11x17

Standard 11*17 format. size in points: 792 * 1224.

enumerator kA3DPDFPageA3

Standard A3 format. size in points: 842 * 1190.

enumerator kA3DPDFPageA4

Standard A4 format. size in points: 595 * 842.

enumerator kA3DPDFPageA5

Standard A5 format. size in points: 420 * 595.

enumerator kA3DPDFPageB4JIS

Standard B4 JIS format. size in points: 728 * 1031.

enumerator kA3DPDFPageB5JIS

Standard B5 JIS format. size in points: 515 * 728.

enumerator kA3DPDFPageExecutive

Standard Executive format. size in points: 522 * 756.

enumerator kA3DPDFPageLegal

Standard Legal format. size in points: 612 * 1008.

enumerator kA3DPDFPageLetter

Standard Letter format. size in points: 612 * 792.

enumerator kA3DPDFPageTabloid

Standard Tabloid format. size in points: 792 * 1224.

enumerator kA3DPDFPageB4ISO

Standard B4 ISO format. size in points: 709 * 1001.

enumerator kA3DPDFPageB5ISO

Standard B5 ISO format. size in points: 499 * 709.

enumerator kA3DPDFPageCustom

The page format must be defined using SetPageSize.

enum A3DPDFEPageOrientation

Page orientation of the PDF document.

Version
4.1

Values:

enumerator kA3DPDFPagePortrait

Standard portrait orientation.

enumerator kA3DPDFPageLandscape

Standard landscape orientation.

Function Documentation

A3DStatus deprecated_A3DPDFDocumentCreateUniquePage(A3DPDFDocument *pDoc, const deprecated_A3DPDFPageData *pPageData, A3DPDFPage **ppPage)

Deprecated:

This function was deprecated in HOOPS Publish 1.10. Use A3DPDFDocumentAppendNewPage2 instead. This will be removed in version 2026.1.0.

This function adds a unique page to an empty PDF document. This function can only be used on a file opened with A3DPDFDocumentCreateEmpty. It can’t be used on a file which already contains a page.

Version
4.1

Parameters:
  • pDoc[inout] The current document on which the new page will be added.
  • pPageData[in] The page data parameters.
  • ppPage[out] The newly-created page.
Return values:

A3D_SUCCESS

Returns:

A3D_SUCCESS in case of success or an error code

A3DStatus deprecated_A3DPDFDocumentAppendNewPage(A3DPDFDocument *pDoc, const deprecated_A3DPDFPageData *pPageData, A3DPDFPage **ppPage)

Appends a new empty page to a document.

Deprecated:

Use A3DPDFDocumentAppendNewPage2 instead. This will be removed in version 2026.1.0.

The page is added at the end of the document. It is a new page created with the options set in the pPageData argument.

Version
4.2

Parameters:
  • pDoc[inout] The Document object to work with.
  • pPageData[in] The page parameters.
  • ppPage[out] The Page object for the new page.
Return values:

A3D_SUCCESS

Returns:

A3D_SUCCESS in case of success or an error code

A3DStatus deprecated_A3DPDFDocumentAppendPageFromPDFFile(A3DPDFDocument *pDoc, const A3DUTF8Char *pcFileName, A3DPDFPage **ppPage)

Deprecated:

Function deprecated, Please use A3DPDFDocumentAppendPageFromPDFFileAndSuffixFields instead. This will be removed in version 2026.1.0.

Appends new pages from a PDF template to a document. Starting with HOOPS Publish 6.0 the input PDF can contain several pages. The pages are added at the end of the document. All pages are copied from the PDF template file specified with the pcFileName argument. If the imported pages contain form fields with names that already exist on other pages of the document, the function will fail. In this situation, use A3DPDFDocumentAppendPageFromPDFFileAndSuffixFields to rename all form fields of the imported pages.

Version
4.2

Parameters:
  • pDoc[inout] The Document object to work with.
  • pcFileName[in] The input file name of the PDF template.
  • ppPage[out] The Page object for the last page inserted.
Return values:

A3D_SUCCESS

Returns:

A3D_SUCCESS in case of success or an error code

A3DStatus deprecated_A3DPDFDocumentCreateUniquePage2(A3DPDFDocument *pDoc, const A3DPDFPageData2 *pPageData, A3DPDFPage **ppPage)

This function adds a unique page to an empty PDF document.

Deprecated:

This function is deprecated. Use A3DPDFDocumentAppendNewPage2 instead. This will be removed in version 2026.1.0.

This function can only be used on a file opened with A3DPDFDocumentCreateEmpty. It can’t be used on a file which already contains a page.

Version
7.2

Parameters:
  • pDoc[inout] The current document on which the new page will be added.
  • pPageData[in] The page data parameters.
  • ppPage[out] The newly-created page.
Return values:

A3D_SUCCESS

Returns:

A3D_SUCCESS in case of success or an error code

A3DStatus deprecated_A3DPDFDocumentGetUniquePage(const A3DPDFDocument *pDoc, A3DPDFPage **ppPage)

Function to get the unique page of the document.

Deprecated:

This function was deprecated in HOOPS Publish 6.0. Use A3DPDFDocumentGetPage instead. This will be removed in version 2026.1.0.

This function only works on a document which contains a single page. It is designed to be called after A3DPDFDocumentCreateFromPDFFile to get the Page object.

Version
4.1

Parameters:
  • pDoc[in] The Document object to work with.
  • ppPage[out] The Page object.
Return values:

A3D_SUCCESS

Returns:

A3D_SUCCESS in case of success or an error code

A3DStatus A3DPDFDocumentGetNumberPages(const A3DPDFDocument *pDoc, A3DInt32 *piNbPages)

Function to get the number of pages in the document.

Version
6.0

Parameters:
  • pDoc[in] The Document object to work with.
  • piNbPages[out] The number of pages. Remember to subtract 1 from this value if you are going to pass it to a method that takes a zero-based page number.
Return values:

A3D_SUCCESS

Returns:

A3D_SUCCESS in case of success or an error code

A3DStatus A3DPDFDocumentGetPage(const A3DPDFDocument *pDoc, const A3DInt32 iNumPage, A3DPDFPage **ppPage)

Function to get a page in the document.

Version
6.0

Parameters:
  • pDoc[in] The Document object to work with.
  • iNumPage[in] The index of the page. The first page is 0.
  • ppPage[out] The Page object.
Return values:

A3D_SUCCESS

Returns:

A3D_SUCCESS in case of success or an error code

A3DStatus A3DPDFDocumentRemovePages(const A3DPDFDocument *pDoc, const A3DInt32 iFirstPage, const A3DInt32 iLastPage)

Function to remove pages in the document.

Version
6.0

Parameters:
  • pDoc[inout] The Document object to work with.
  • iFirstPage[in] The index of the first page to remove. The first page is 0.
  • iLastPage[in] The index of the last page to remove.
Return values:

A3D_SUCCESS

Returns:

A3D_SUCCESS in case of success or an error code

A3DStatus A3DPDFDocumentAppendNewPage2(A3DPDFDocument *pDoc, const A3DPDFPageData2 *pPageData, A3DPDFPage **ppPage)

Appends a new empty page to a document.

The page is added at the end of the document. It is a new page created with the options set in the pPageData argument.

Version
7.2

Parameters:
  • pDoc[inout] The Document object to work with.
  • pPageData[in] The page parameters.
  • ppPage[out] The Page object for the new page.
Return values:
  • A3D_SUCCESS
  • A3D_INVALID_ENTITY_NULL – if pDoc or ppPage are null.
  • A3D_INVALID_DATA_STRUCT_NULL – if pPageData is null.
Returns:

A3D_SUCCESS in case of success or an error code

A3DStatus A3DPDFDocumentAppendPageFromPDFFileEx(A3DPDFDocument *pDoc, const A3DUTF8Char *pcFileName, const A3DBool bRenameFields, A3DPDFPage **ppPage)

Appends new pages from a PDF template to a document, with the possibility to rename all form fields to avoid PDF conflicts. This method supersedes A3DPDFDocumentAppendPageFromPDFFile() in A3DLIBS 4.3 and later. Starting from HOOPS Publish 6.0 the input PDF can contain several pages. The pages are added at the end of the document. All pages are copied from the PDF template file specified with the pcFileName argument. If the imported pages contain form fields with names that already exist on other pages of the document, the function will fail. In this situation, set the bRenameFields parameter to true to rename all form fields of the imported pages.

Version
4.3

Warning

All references to the renamed form fields have to be modified to reflect the new names. This has to be done for example for JavaScript code that could work with these fields. Please refer to the section ‘Field Names’ in programming guide for a description of specific cases with field names.

Parameters:
  • pDoc[inout] The Document object to work with.
  • pcFileName[in] The input file name of the PDF template.
  • bRenameFields[in] If true, the form fields of the template pages are renamed, appending the position of the pages in the final document to every fields. Note that the index of the first page is 1. For example, a field ‘MyTitle’ will be renamed ‘MyTitle_1’ if the page is inserted as the first page of the document. If false, the form fields are not renamed and the function will fail if some fields already exist on the document with the same name.
  • ppPage[out] The Page object for the last page inserted.
Return values:
  • A3D_SUCCESS
  • A3D_INVALID_ENTITY_NULL – if pDoc, pcFileName or ppPage are null.
  • A3DPDF_CANNOT_ACCESS_FILE – if pcFileName is not valid.
Returns:

A3D_SUCCESS in case of success or an error code

A3DStatus A3DPDFDocumentAppendPageFromPDFFileAndSuffixFields(A3DPDFDocument *pDoc, const A3DUTF8Char *pcFileName, const A3DUTF8Char *pcAppendStringToFieldNames, A3DPDFPage **ppPage)

Appends new pages from a PDF template to a document, with the possibility to rename all form fields to avoid PDF conflicts. This method supersedes A3DPDFDocumentAppendPageFromPDFFile() in A3DLIBS 11.1 and later.

Starting from HOOPS Publish 6.0 the input PDF can contain several pages. The pages are added at the end of the document. All pages are copied from the PDF template file specified with the pcFileName argument.

If the imported pages contain form fields with names that already exist on other pages of the document, the function will fail. In this situation, set the pcAppendStringToFieldNames parameter to rename all form fields of the imported pages.

Version
11.1

Details

When using pcAppendStringToFieldNames to modify field names, please be aware of the following:

  • If the string is not empty, the field name is suffixed with it. For example, a field ‘MyTitle’ with pcAppendStringToFieldNames set to ‘abcd’ will be renamed ‘MyTitle_abcd’. Please refer to the section ‘Field Names’ in programming guide for a description of specific cases with field names.

    If the field has been copied/pasted in Acrobat, then the field is renamed ‘fieldname_appendstring.index’.

    If the field belongs to a group of fields, then the field is renamed ‘groupname_appendstring.fieldname’.

    If the field is a radio button, then the field is renamed ‘radiobuttongroupname_appendstring.index’.

  • If pcAppendStringToFieldNames is NULL or empty, the form fields are not renamed and the function will fail if fields already exist in the document with the same name.

Warning

All references to the renamed form fields have to be modified to reflect the new names. This has to be done for example for JavaScript code that could work with these fields. Please refer to the section ‘Field Names’ in programming guide for a description of specific cases with field names.

Parameters:
  • pDoc[inout] The Document object to work with.
  • pcFileName[in] The input file name of the PDF template.
  • pcAppendStringToFieldNames[in] The string that is appended to all form fields. Please see the details section below for more information.
  • ppPage[out] The Page object for the last page inserted.
Return values:
  • A3D_SUCCESS
  • A3D_INVALID_ENTITY_NULL – if pDoc, pcFileName or ppPage are null.
  • A3DPDF_CANNOT_ACCESS_FILE – if pcFileName is invalid.
Returns:

A3D_SUCCESS in case of success or an error code