Give us feedback
pdf-helper
Service icon

PDF Helper

icon_trusted
Stable version 1.0.11 (Compatible with OutSystems 11)
Other versions available for 10 and Older
Uploaded on 7 Jun by 
4.9
 (9 ratings)
pdf-helper

PDF Helper

Documentation
1.0.11


About PDF Helper:


The OutSystems PDF Helper Component is an extension designed to enhance OutSystems applications with the capability to generate and manipulate PDF documents. This component is crafted to perform certain activities on PDFs within the OutSystems low-code environment.

The PDF Helper Component uses itextsharp and Ghostscript libraries. To know more about it follow the links:

  1. https://itextpdf.com/products/itextsharp,

  2. https://www.ghostscript.com/


This extension contains very commonly used actions for PDFs like:


  1. PDFSecurityCheck: Validates if a PDF contains JavaScript.
  2. AddText: Adds text to a PDF.
  3. AddTextWatermarkInPDF_Memory: Adds watermark text in PDF using memory.
  4. AddTextWatermarkInPDF_TempPath: Adds watermark text in PDF using a temporary path.
  5. CompressPDF: Compresses a PDF file.
  6. ExtractImagesFromPDF: Extracts images from a PDF.
  7. GenerateThumbnail: Generates a thumbnail from a PDF.
  8. GetPDFAnnotation: Retrieves annotations from a PDF.
  9. JoinPDF: Merges multiple PDF files.
  10. PrintPageNumber: Adds page numbers to a PDF.
  11. ReadTextFromPDF: Reads text from a PDF.


How to use PDF Helper:

  1. Add the component as a Dependency of your project, Go to your Service Studio environment, click the manage dependencies button on the top menu, and add the following references to your Reactive Web Application.

  2. Drag the server action to a client or server action.

  3. Assign the correct Input parameters.

  4. Then use the output from the action.




1. Add Text Watermark (Server Action)

By using the AddTextWatermarkInPDF_Memory action you can add a text watermark in the PDF and maintain its text size, The watermark is added on every page of the PDF.

Input(s)

PDF

  • Binary data of the PDF we want to write the watermark on.

Watermark Text  

  • Text Needs to be printed as a watermark on the PDF.

Text Size

  • Size of Text of the watermark.


Output(s)

OutPDF 

  • PDF Binary Data with watermark text printed.

ErrorMessage

  • Text error message.




2. Compress PDF (Server Action)

By using the CompressPDF action you can reduce the size of a PDF.

Input 

PDF

  • Binary Data file to compress.


Output(s)

CompressedPDF

  • Compressed Binary Data file.

IsSussess

  • Boolean if the file has been compressed or not.

ErrorMessage

  • Text error message.




3. Read text from PDF (Server Action)

By using the ReadtextfromPDF action we can read the text from a PDF.


Input  

PDFBytes

  • Binary Data for which we want the text to be extracted. 


Output(s) 

PDFText

  • The extracted text from the PDF.

ErrorMessage

  • Text error message.




4. Join PDF (Server Action)

By using the JoinPDF action we can merge multiple PDF files and make a single PDF.

Input

PDFileList 

  • A list of Binary Data of PDFs that we want to join into a single PDF.


Output(s) 

JoinedPDF

  • A binary data of the merged PDFs.

ErrorMessage

  • Text error message.




5. Print Page Number (Server Action)

By using the PrintPageNumber action we can add the page number on the PDF pages and manage the position of the number.

Input(s)
PdfByte

  • Binary data on which the page number will be placed.

XAxis

  • Integer the position of the X-Axis where we want the page number.  

YAxis  

  • Integer the position of the Y-Axis where we want the page number.

PaginationText

  • A custom text can be passed to format the output text of pagination.


Output

PDFOutByte

  • The Binary data with Page Number imprinted.




6. Remove JS (Server Action)

By using the RemoveJavascript action we can remove the Java script from a PDF file.

Input
PDF

  • Binary data form which we want to remove JavaScript.


Output
OutPDF

  • Binary Data with JavaScript removed.




7. Get PDF Annotation (Server Action)

By using GetPDFAnnotation you can add notes & annotations to any PDF document: Comments, corrections, signatures, highlighting, and even photos and drawings. Save annotations in the original file.

Input 

PDFBytes 

  • Binary Data for which we want the annotation to be extracted. 


Output

Comments 

  • A structure that will have the ID, page number, Author, Comment, and Datetime.

ErrorMessage

  • Text error message.




8. Add Text (Server Action)

By using the AddText action we can add the text on the PDF pages, manage the position and the size

Input(s)
PdfByte

  • Binary data on which the page number will be placed.

XAxis

  • Integer the position of the X-Axis where we want text.  

YAxis  

  • Integer the position of the Y-Axis where we want text.

Text

  • A custom text can be passed to format the output text.

FontSize 

  • The Font size that you can define.


Output

PDFOutByte

  • The Binary data with text imprinted.




9. ExtractImagesFromPDF(Server Action)

By using the ExtractImagesFromPDF action you can convert PDF into an image.

Input
PDF

  • Binary data of the PDF we want to make an image.


Output(s)
Image

  • Binary Data and file extension in the structure of the Image Record List type.

ErrorMessage

  • Text error message.





10. PDFSecurityCheck(Server Action)

Validates if an existing PDF file contains embedded JavaScript. This method helps developers identify potential security risks by checking for scripts within the PDF. It returns a Boolean indicating whether the PDF is free of any potentially malicious scripts.

Input
PDF

  • Binary data of the PDF we want to make an image.


Output(s)
IsValid

  • Returns True if the PDF is free from embedded JavaScript, indicating it is safe. Returns False if the PDF contains any embedded JavaScript, indicating a potential security risk.

ErrorMessage

  • Error Message if something goes wrong




1.0.10


About PDF Helper:


The OutSystems PDF Helper Component is an extension designed to enhance OutSystems applications with the capability to generate and manipulate PDF documents. This component is crafted to perform certain activities on PDFs within the OutSystems low-code environment.

The PDF Helper Component uses itextsharp and Ghostscript libraries. To know more about it follow the links:

  1. https://itextpdf.com/products/itextsharp,

  2. https://www.ghostscript.com/


This extension contains very commonly used actions for PDFs like:


  1. Add Watermark

  2. Compress PDF

  3. Read text from PDF

  4. Join PDF

  5. Print number on PDF

  6. Get PDF Annotation

  7. Add Text

  8. RemoveJS

  9. ExtractImagesFromPDF


How to use PDF Helper:

  1. Add the component as a Dependency of your project, Go to your Service Studio environment, click the manage dependencies button on the top menu, and add the following references to your Reactive Web Application.

  2. Drag the server action to a client or server action.

  3. Assign the correct Input parameters.

  4. Then use the output from the action.




1. Add Text Watermark (Server Action)

By using the AddTextWatermarkInPDF_Memory action you can add a text watermark in the PDF and maintain its text size, The watermark is added on every page of the PDF.

Input(s)

PDF

  • Binary data of the PDF we want to write the watermark on.

Watermark Text  

  • Text Needs to be printed as a watermark on the PDF.

Text Size

  • Size of Text of the watermark.


Output(s)

OutPDF 

  • PDF Binary Data with watermark text printed.

ErrorMessage

  • Text error message.




2. Compress PDF (Server Action)

By using the CompressPDF action you can reduce the size of a PDF.

Input 

PDF

  • Binary Data file to compress.


Output(s)

CompressedPDF

  • Compressed Binary Data file.

IsSussess

  • Boolean if the file has been compressed or not.

ErrorMessage

  • Text error message.




3. Read text from PDF (Server Action)

By using the ReadtextfromPDF action we can read the text from a PDF.


Input  

PDFBytes

  • Binary Data for which we want the text to be extracted. 


Output(s) 

PDFText

  • The extracted text from the PDF.

ErrorMessage

  • Text error message.




4. Join PDF (Server Action)

By using the JoinPDF action we can merge multiple PDF files and make a single PDF.

Input

PDFileList 

  • A list of Binary Data of PDFs that we want to join into a single PDF.


Output(s) 

JoinedPDF

  • A binary data of the merged PDFs.

ErrorMessage

  • Text error message.




5. Print Page Number (Server Action)

By using the PrintPageNumber action we can add the page number on the PDF pages and manage the position of the number.

Input(s)
PdfByte

  • Binary data on which the page number will be placed.

XAxis

  • Integer the position of the X-Axis where we want the page number.  

YAxis  

  • Integer the position of the Y-Axis where we want the page number.

PaginationText

  • A custom text can be passed to format the output text of pagination.


Output

PDFOutByte

  • The Binary data with Page Number imprinted.




6. Remove JS (Server Action)

By using the RemoveJavascript action we can remove the Java script from a PDF file.

Input
PDF

  • Binary data form which we want to remove JavaScript.


Output
OutPDF

  • Binary Data with JavaScript removed.




7. Get PDF Annotation (Server Action)

By using GetPDFAnnotation you can add notes & annotations to any PDF document: Comments, corrections, signatures, highlighting, and even photos and drawings. Save annotations in the original file.

Input 

PDFBytes 

  • Binary Data for which we want the annotation to be extracted. 


Output

Comments 

  • A structure that will have the ID, page number, Author, Comment, and Datetime.

ErrorMessage

  • Text error message.




8. Add Text (Server Action)

By using the AddText action we can add the text on the PDF pages, manage the position and the size

Input(s)
PdfByte

  • Binary data on which the page number will be placed.

XAxis

  • Integer the position of the X-Axis where we want text.  

YAxis  

  • Integer the position of the Y-Axis where we want text.

Text

  • A custom text can be passed to format the output text.

FontSize 

  • The Font size that you can define.


Output

PDFOutByte

  • The Binary data with text imprinted.




9. ExtractImagesFromPDF(Server Action)

By using the ExtractImagesFromPDF action you can convert PDF into an image.

Input
PDF

  • Binary data of the PDF we want to make an image.


Output(s)
Image

  • Binary Data and file extension in the structure of the Image Record List type.

ErrorMessage

  • Text error message.