Unofficial Content

This document belongs to the PDF Tools project

For GeneXus 9.0 (only .NET)

For the features

  1. Add password (ModifyPermissions)
  2. Digitally sign a document (AddSignature)
  3. Concatenate several pdf files (ConcatFiles)
  4. Modify permissions

Each functionality is in separate XPZ so that it is not necessary to consolidate unnecessary objects.

As of Upgrade 3 of the .NET generator, the iTextSharp library is started to generate PDFs, so if you are working with these versions, you do not need to do anything extra. If you are working with a lower upgrade, you must download the iTextSharp project from SourceForge and copy the respective dlls into the bin folder of the model and reference the dlls in the "Compiler flag" property.

For the functionality "Watermark" (AddWatermark) - Only available for .NET:

A full GeneXus option to generate a watermark in a report is to use the NOSKIP command, with this it is possible to enter an image below the text, the problem of this solution is that it is complicated to have several sheets to be in the same position.
One solution to this is to use CSHARP code to invoke methods from the iText library (the library that GeneXus uses to generate the PDFs).
GeneXus 9.0 upgrade 3 uses the iTextsharp library instead of iTextDotNet which is a native Csharp implementation of the iText libraries instead of a conversion using J # as was the version of iTextDotnet, the watermark generation features They have not yet been generated in the iTextSharp project so you have to use the other library, so you may not have this library at hand if you use GeneXus versions 9.0 u3 or higher.

Steps:

1) Import XPZ PDF_TOOLS_AddWatermark_GX90.xpz
2) Download the project http://sourceforge.net/projects/itextdotnet/ (see annex) and copy its dlls in the bin folder of the model
3) Associate the model property "compiler flag" = /r:bin\iText.dll
Notes: In the case of web access, verify that the user who runs the web application (generally ASPNET has read and write permissions on the directory where you work).

For GeneXus X or higher (.NET and Java)

Use the GeneXus Marketplace to download the features and associated dependencies, import the dependencies first and then the requierd features; notice that using the StartPage from the IDE will only install the features.

For the features:

  1. Add password (ModifyPermissions)
  2. Digitally sign a document (AddSignature)
  3. Concatenate several pdf files (ConcatFiles)
  4. Modify permissions
  5. Get text

Only import the XPZ.

For Watermark:

1) Import XPZ PDF_TOOLS_AddWatermark_GXX.xpz

2) Download the project http://sourceforge.net/projects/itextdotnet/ (See annex if you use C #) and copy your dlls in the bin folder of the model. (Can be accessed quickly from the menu option View - Knowledge Base Information)

So that the modification of the compiler flag property does not affect other objects, a new .net generator can be created (since this property is at the generator level) for this:
3) Create a .NET Generator with the property "compiler flag" = /r:bin\iText.dll,vjslib.dll (without spaces)
4) Associate the main object that calls the procedure with the previously created generator
Note: If you do not have Microsoft J # installed, it must be installed. (But errors occur when compiling)

How to download the iTextDotNet project

Go to: http://sourceforge.net/projects/itextdotnet

PDF Tools Image 01

PDF Tools Image 02

Then

PDF Tools Image 03

Then it is necessary to copy the contents of the file to the bin directory of the model:

PDF Tools Image 04

Common Errors

When compiling, the error message is issued:

pdfaddwatermark.cs(163,18): error CS0234: The type or namespace name 'lowagie' does not exist in the namespace 'com' (are you missing an assembly reference?)
pdfaddwatermark.cs(112,18): error CS0234: Nome do espa‡o para nome ou tipo 'lowagie' no existe no espacio para nome 'com'. Precisa de uma referencia de modulo (assembly)?

PDF Tools Image 05

This can be caused by:
1) Copy of the iTextDotNet project dlls inside the bin directory of the model
2) Missing set the compiler flag as indicated.

Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant