
#####################################
A3DPDFDocumentAppendPageFromPDFFileEx
#####################################

.. c:function:: A3DStatus A3DPDFDocumentAppendPageFromPDFFileEx(A3DPDFDocument *pDoc, const A3DUTF8Char *pcFileName, const A3DBool bRenameFields, A3DPDFPage **ppPage)

   .. rst-class:: sig-pretty-signature
   
      | :c:enum:`~A3DStatus` A3DPDFDocumentAppendPageFromPDFFileEx(:c:type:`~A3DPDFDocument`\ \* **pDoc**\ , *const* :c:type:`~A3DUTF8Char`\ \* **pcFileName**\ , *const* :c:type:`~A3DBool` **bRenameFields**\ , :c:type:`~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.
   
   
      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.
   
   
   **Return Values**
   
   
      **A3D_SUCCESS**\ :
   
      **A3D_INVALID_ENTITY_NULL**\ : if ``pDoc``\ , ``pcFileName`` or ``ppPage`` are null.
   
      **A3DPDF_CANNOT_ACCESS_FILE**\ : if ``pcFileName`` is not valid.
   
   
   
      4.3
   
   
   **Parameters**
   
   
      **pDoc**\ : The Document object to work with.
   
      **pcFileName**\ : The input file name of the PDF template.
   
      **bRenameFields**\ : 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**\ : The Page object for the last page inserted.
   
   
   **Returns**
   
   
      A3D_SUCCESS in case of success or an error code
   
   




