Skip to content

Commit

Permalink
Merge pull request #33 from datalogics-josepha/qr
Browse files Browse the repository at this point in the history
Add QRCode sample.
  • Loading branch information
datalogics-robl authored Mar 12, 2024
2 parents 0cadcb3 + 3e78c00 commit b315590
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
40 changes: 40 additions & 0 deletions ContentModification/AddQRCode/AddQRCode.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
}
}
14 changes: 14 additions & 0 deletions ContentModification/AddQRCode/AddQRCode.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Adobe.PDF.Library.LM.NET" Version="18.*" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions ContentModification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit b315590

Please sign in to comment.