diff --git a/ContentModification/AddQRCode/AddQRCode.cs b/ContentModification/AddQRCode/AddQRCode.cs new file mode 100644 index 0000000..5cd16aa --- /dev/null +++ b/ContentModification/AddQRCode/AddQRCode.cs @@ -0,0 +1,40 @@ +using System; +using Datalogics.PDFL; + +/* + * + * This sample shows how to add a QR barcode to a PDF page + * + * Copyright (c) 2024, Datalogics, Inc. All rights reserved. + * + */ +namespace AddCollection +{ + class AddQRCode + { + static void Main(string[] args) + { + Console.WriteLine("AddQRCode Sample:"); + + using (Library lib = new Library()) + { + Console.WriteLine("Initialized the library."); + + String sInput = Library.ResourceDirectory + "Sample_Input/sample_links.pdf"; + String sOutput = "../AddQRCode-out.pdf"; + + if (args.Length > 0) + sInput = args[0]; + + using (Document doc = new Document(sInput)) + { + Page page = doc.GetPage(0); + + page.AddQRBarcode("Datalogics", 72.0, page.CropBox.Top - 1.5 * 72.0, 72.0, 72.0); + + doc.Save(SaveFlags.Full, sOutput); + } + } + } + } +} diff --git a/ContentModification/AddQRCode/AddQRCode.csproj b/ContentModification/AddQRCode/AddQRCode.csproj new file mode 100644 index 0000000..a452af9 --- /dev/null +++ b/ContentModification/AddQRCode/AddQRCode.csproj @@ -0,0 +1,14 @@ + + + + Exe + net6.0 + enable + enable + + + + + + + diff --git a/ContentModification/README.md b/ContentModification/README.md index 8b6c3ff..caeb696 100644 --- a/ContentModification/README.md +++ b/ContentModification/README.md @@ -4,6 +4,9 @@ Creates an action associated with a link annotation on a PDF page. ## ***AddCollection*** Adds a collection to a PDF document to turn that document into a PDF Portfolio. +## ***AddQRCode*** +Adds a QR barcode to the Page of a PDF document. + ## ***ChangeLayerConfiguration*** Sets the on/off states for Optional Content Groups (Layers) within a PDF document.