-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from datalogics-josepha/qr
Add QRCode sample.
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters