Option to disable AGPL-usage warning messages
When using iText Core in AGPL mode (without loading an iText license) a message will occasionally be printed to the standard output.
You are using iText under the AGPL.
If this is your intention, you have published your own source code as AGPL software too.
Please let us know where to find your source code by sending a mail to agpl@itextpdf.com
We'd be honored to add it to our list of AGPL projects built on top of iText 7
and we'll explain how to remove this message from your error logs.
If this wasn't your intention, you are probably using iText in a non-free environment.
In this case, please contact us by filling out this form: http://itextpdf.com/sales
If you are a customer, we'll explain how to install your license key to avoid this message.
If you're not a customer, we'll explain the benefits of becoming a customer.
We added the option (> 7.2.2 versions) to disable these messages as demonstrated in the following code example.
Java
import com.itextpdf.commons.actions.EventManager;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.element.Paragraph;
import java.io.ByteArrayOutputStream;
public class Main {
public static void main(String[] args) {
//This line of code allow us to disable the AGPL warning messages
//Note that you acknowledge and agree with the AGPL license requirements when you call this method
EventManager.acknowledgeAgplUsageDisableWarningMessage();
// We are creating PDFs in a loop so that we can trigger the AGPL message
for (int x = 0; x < 100000; x++) {
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(new ByteArrayOutputStream()));
Document document = new Document(pdfDocument);
document.add(new Paragraph("Hello world"));
pdfDocument.close();
}
}
}
C#
using iText.Commons.Actions;
using iText.IO.Source;
using iText.Kernel.Pdf;
using iText.Layout;
using iText.Layout.Element;
namespace Example
{
class Program
{
static void Main(string[] args)
{
//This line of code allow us to disable the AGPL warning messages
//Note that you acknowledge and agree with the AGPL license requirements when you call this method
EventManager.AcknowledgeAgplUsageDisableWarningMessage();
// We are creating PDFs in a loop so that we can trigger the AGPL message
for (int x = 0; x < 100000; x++)
{
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(new ByteArrayOutputStream()));
Document document = new Document(pdfDocument);
document.Add(new Paragraph("Hello world"));
pdfDocument.Close();
}
}
}
}
Note that disabling this message does not mean the AGPL requirements are also disabled! You are still running iText in AGPL mode, and as such you are still obliged to follow the AGPL license requirements.