User Tools

Site Tools


pdf_adaptor

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pdf_adaptor [2023/11/21 07:11]
montse
pdf_adaptor [2024/12/10 13:03] (current)
montse [Predefined Functions]
Line 1: Line 1:
 ====== PDF Adaptor ====== ====== PDF Adaptor ======
 =====Introduction ===== =====Introduction =====
-PDF adaptor allow you to interact with a .pdf file, so that you can check if it has been generated properly and contains the information it is supossed ​to. It will be useful for you to test all those procesess ​where the generation of a .pdf file is implied.+PDF adaptor allow you to interact with a .pdf file, so that you can check if it has been generated properly and contains the information it is supposed ​to. It will be useful for you to test all those processes ​where the generation of a .pdf file is implied.
  
 ===== Initialization Parameters ===== ===== Initialization Parameters =====
Line 7: Line 7:
   * **FilePath:​** complete path of the file   * **FilePath:​** complete path of the file
  
-===== Predefined ​Functions (PF): =====+===== Predefined ​functions ​=====
  
-  * **addBreakLine**:​ Allows you to add a line break to the document, at the position where it is located. 
  
-  * **addFooterText**: Allows you to add footer ​text to the document.+  * **checkTextOnDocument(Page Area, Search Text)**: looks for given text on a specific area of the document ​(whole Page, Header, Body, Footer). This function looks for an exact match of the search text.
  
-  * **addHeaderText**: Allows you to add a text to the page header ​in the document.+  * **checkTextOnPage**: returns true, if it finds the text specified by the Search Text parameter, ​in the area indicated by the PageArea parameter, on the page represented by the Page parameter, the number of times entered in Ocurrences, false otherwise.
  
-  * **addImageFile**: Allows you to add an image to the document.+  * **checkTextOnPageArea(Page,​ CoordinateX,​ CoordinateY,​ Width, Height, Text):** this function return true if the parameter text exists inside the page area defined by the parameters. Page parameter indicates the page number ​to transform. Coordinate X parameter, indicates the position x where the area starts. Coordinate Y parameter, indicates the position y where the area starts. Width and height parameters indicates the area and the text parameter, it’s the text to check on the defined area. The measure unit is 72 dpi.
  
-  * **addPage**: Allows you to add blank page to the PDF document.+  * **generateFileAsEvidence**: the function generates ​copy of the PDF file in its current state to be added as evidence.
  
-  * **addParagraph**: Allows you to add a paragraph to the PDF document.+  * **getCustomMetaData**: returns ​the value of the custom metadata specified in its input parameter. Custom metadata is different from the automatic metadata that is manually included in documents. The metadata name is case sensitive.
  
-  * **addTable**: Allows you to add a table to the PDF document.+  * **getDataSigned**: gets the signature data of the document ​in case it is digitally signed. Returns in output a variable TastTableData. The data is returned in one row and N columns.
  
-  * **checkTableOnPage**: Returns true if a table exists on the specified page of the PDF documentfalse otherwise.+  * **getMetaData**: returns ​the value of the metadata selected in the dropdown of the input parameter. These are the automatic metadata such as: title, author, subject, keyWords, creator, producer, pageCount, creationDate,​ modificationDatetraped.
  
-  * **checkTextBoldOnDocument**:​ Returns true, if all occurrences of the Search Text in the document have the Bold attribute disabled/​enabled as passed as parameter. +  * **getNumPages()**: returns the number of pages in the document.
- +
-  * **checkTextBoldOnPage**:​ Returns true, if it checks that the first occurrence of the Search Text on the page has the Bold attribute set to On or Off. +
- +
-  * **checkTextColor**:​ +
- +
-  * **checkTextColorOnDocument**:​ Returns True, if all occurrences of Search Text in the document have the configured color. +
- +
-  * **checkTextColorOnPage**:​ Returns true, if the Search Text appears on the indicated page with the configured color. +
- +
-  * **checkTextFontSizeOnDocument**:​ Returns true, if the Search Text size is the indicated in all its occurrences in the document. +
- +
-  * **checkTextFontSizeOnPage**:​ Returns true, if the size of the first occurrence of the Search Text on the page is the size specified as parameter. False otherwise. +
- +
-  * **checkTextFontTypeOnDocument**:​ Returns true, if the font type of the Search Text is the one indicated in all its appearances in the document. False otherwise. +
- +
-  * **checkTextFontTypeOnPage**:​ Returns true, if the font type of the first occurrence of the Search Text page is the one passed as parameter. +
- +
-  * **checkTextInSlide(Page, Occurrences,​ Search Text, ExactSearch)**: Looks for a given text on a specific Page of the document. Checks if it is present the number of times expressed in "​Occurences"​ and returns ​"​true"​ or "​false"​ accordingly. "Exact Search"​ allows you to tell the function if you are looking for an exact match or if the number of spaces between each part of the Search String is variable.\\ \\  **IMPORTANT**:​ Please be aware of the "​Occurrences"​ behaviour:​ +
-           - When Occurrences is "​empty",​ it will check that the string exists, no matter the number of times. +
-           - When Occurrences is different to "​0",​ it will check that the Search String exists the indicated number of times. +
-           - When Occurrences is "​0",​ it will check that the Search String does not exist, returning "​true"​ if so, "​false"​ if it is found any number of times. ​  +
- +
-  * **checkTextOnDocument(Page Area, Search Text)**: Looks for a given text on a specific area of the document (whole Page, Header, Body, Footer). This function looks for an exact match of the search text. +
- +
-  * **checkTextOnPage**:​ Returns true, if it finds the text specified by the Search Text parameter, in the area indicated by the PageArea parameter, on the page represented by the Page parameter, the number of times entered in Ocurrences, false otherwise. +
- +
-  * **checkTextOnPageArea(Page,​ CoordinateX,​ CoordinateY,​ Width, Height, Text):** This function return true if the parameter text exists inside the page area defined by the parameters. Page parameter indicates the page number to transform. Coordinate X parameter, indicates the position x where the area starts. Coordinate Y parameter, indicates the position y where the area starts. Width and height parameters indicates the area and the text parameter, it’s the text to check on the defined area. The measure unit is 72 dpi. +
- +
-  * **copyFile**:​ +
- +
-  * **createPdfFile**:​ Allows to create a PDF file in the path and with the name passed as parameter. +
- +
-  * **generateFileAsEvidence**:​ The function generates a copy of the PDF file in its current state to be added as evidence. +
- +
-  * **getFormFieldType**:​ +
- +
-  * **getFormsFieldsNames**:​ Retrieve an array with the names of all the form fields existing in the PDF document. +
- +
-  * **getNumColumns**:​ Returns the number of columns of the TastTableData generated by reading a table from the PDF file with the getPdfTableAsDataTable function. +
- +
-  * **getNumPages()**:​ Returns ​the number of pages in the document.+
  
   * **getNumRows**:​   * **getNumRows**:​
  
-  * **getNumWhitePages()**: ​Returns ​the number of white pages in the document+  * **getNumWhitePages()**: ​returns ​the number of white pages in the document.
- +
-  * **getPageAsImage(Page,​File):​** This function transform a PDF Page into a jpg image file with a resolution of 72 dpi. About the input parameters, the Page parameter indicates the page number to transform, The File parameter indicates the path and the file name where the image will be generated. The file extension is .jpg.\\ The purpose of this image is to allow the user to load it into any application that helps him to identify the coordinates where a piece of text appears.\\ Besides that, if Get Evidences is checked, the function generates the image file in the log directory as the step evidence. +
- +
-  * **getPageText:​** Allows you to retrieve the text contained in a page of a PDF, and the function generates as evidence a file with the retrieved text. +
- +
-  * **getPDFTableAsDataTable**:​ This function generates a TastTableData object, reading the table of the PDF document located on the page indicated by Page, in the order indicated by NumTable. The header parameter allows to indicate whether the first line of the table should be considered as data or header. +
- +
-  * **getTableValue**:​ +
- +
-  * **getTextByPageArea(Page,​ CoordinateX,​ CoordinateY,​ Width, Height):** This function extract and return the text that its contained inside the page area defined by the parameters. Page parameter indicates the page number to transform. Coordinate X parameter, indicates the position x where the area starts. Coordinate Y parameter, indicates the position y where the area starts. Width and height parameters indicates the area. The measure unit is 72 dpi. +
- +
-  * **getTextCountOnDocument(Search Text)**: Counts the number of times the Search Text is present on the document. +
- +
-  * **getTextCountOnPage(Page,​ Search Text, Page Area)**: Counts the number of times the Search Text is present on a specific area (Page, Header, Body, Footer) of a given page. The function looks for exact matches of the given Search Text. +
- +
-  * **getTextPositionOnDocument**:​ Returns the X, Y coordinates of the first occurrence of the Search Text in the document. +
- +
-  * **getTextPositionOnPage**:​ Returns the X, Y coordinates of the first occurrence of the Search Text on the page represented by Page. +
- +
-  * **isPageWhite(Page)**:​ Returns “true” if the specified page is white, “false” otherwise. +
- +
-  * **readPdfFile**:​ Reads a PDF file and loads it for processing. +
- +
-  * **renameFile**:​ This function allows you to rename the pdf file.+
  
-  * **setBold**: Allows you to set Bold On/Off for texts that are subsequently added to the document.+  * **getPageAsImage(Page,​File):​** this function transform a PDF Page into a jpg image file with a resolution of 72 dpi. About the input parameters, the Page parameter indicates the page number ​to transform, The File parameter indicates the path and the file name where the image will be generated. The file extension is .jpg.\\ The purpose of this image is to allow the user to load it into any application ​that helps him to identify the coordinates where a piece of text appears.\\ Besides that, if Get Evidences is checked, the function generates the image file in the log directory as the step evidence.
  
-  * **setDefaultAlignment**: Allows ​you to configure ​the alignment ​of the texts you add later to the document.+  * **getPageText:​** allows ​you to retrieve ​the text contained in a page of a PDF, and the function generates as evidence a file with the retrieved text.
  
-  * **setDefaultFont**: Allows you to set the font type to be used when writing text in the document.+  * **getTextCountOnDocument(Search Text)**: counts ​the number of times the Search Text is present on the document.
  
-  * **setDefaultFontColor**: Allows you to set the color of the text to be added to the document later.+  * **getTextCountOnPage(Page,​ Search Text, Page Area)**: counts ​the number ​of times the Search Text is present on a specific area (Page, Header, Body, Footer) of a given page. The function looks for exact matches of the given Search Text.
  
-  * **setDefaultFontSize**: Allows you to set the font size for the text to be added to the document later.+  * **getTextPageByArea(Page,​ CoordinateX,​ CoordinateY,​ Width, Height):** this function extract and return ​the text that its contained inside the page area defined by the parameters. Page parameter indicates the page number ​to transform. Coordinate X parameter, indicates the position x where the area starts. Coordinate Y parameter, indicates the position y where the area starts. Width and height parameters indicates ​the area. The measure unit is 72 dpi.
  
-  * **setFormCheckBox**:+  * **isPageWhite(Page)**: returns “true” if the specified page is white, “false” otherwise.
  
-  * **setItalic**: Allows you to set Italic On/Off for texts that are added later to the document.+  * **isSigned**: returns in its boolean output variable, **true** or **false**, depending on whether ​the document ​is digitally signed or not.
  
-  * **setUnderLinePattern**: Allows you to set the underline pattern to be used in the texts that are subsequently added to the document.+  * **readPdfFile**: reads a PDF file and loads it for processing.
  
-  * **typeOnFormField**:​ Allows to write a value in a form field in the document, using as parameters the qualified name of the field and the value to write. 
  
  
  
pdf_adaptor.1700550670.txt.gz · Last modified: 2023/11/21 07:11 by montse