> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/uwp/get-started/integration/pdfnetcuwp.md).

# Manually integrating PDFNetC PDF library for UWP

Develop UWP apps with Apryse's C++ PDF SDK for Windows. Integrate free trial, run samples, and troubleshoot with Visual Studio 2019. Download now! The Apryse uwp SDK streamlines secure document proces

This SDK is made for those developing UWP apps and require a pure C++ PDF SDK that only uses the allowed Win32 and COM API's to pass the Windows App Certification in order to be published on Microsoft Store.

This guide will help you [run Apryse samples](#run-the-samples) and [integrate a free trial of the Apryse SDK into C++ applications](#integrate-into-your-application) on Windows. Your free trial includes full support from solution engineers..

## Prerequisites

* [Visual Studio](https://visualstudio.microsoft.com/vs/older-downloads/)Make sure that the `Desktop development with C++` workload is part of your installation.This guide will use Visual Studio 2019 and the x64-bit SDK version.
* Apryse's PDF library for UWP:

Download the SDK

[download C/C++ (64-bit) for UWP](https://pdftron.s3.amazonaws.com/custom/ID-zJWLuhTffd3c/mobilechannel_6D420A76/UniversalApps-gr)%24s3%5Ej/PDFNetC64UWP\_9.1.1.zip)

Download the SDK

[download C/C++ (ARM64) for UWP](https://pdftron.s3.amazonaws.com/custom/ID-zJWLuhTffd3c/mobilechannel_6D420A76/UniversalApps-gr)%24s3%5Ej/PDFNetCARM64UWP\_9.1.1.zip)

{% hint style="info" %}
**No trial license key required.**

The trial of Apryse Mobile SDK does not require a trial key. A commercial license key is required for use in a production environment. Please [contact sales](https://apryse.com/form/contact-sales) to purchase a commercial key or if you need any other license key assistance.
{% endhint %}

{% hint style="warning" %}
**Keep your license keys confidential.**

License keys are uniquely generated. Please make sure that it is not publicly available (e.g. in your public GitHub).
{% endhint %}

## Initial setup

Extract the folder from the .zip file.

**This article uses `PDFNET_BASE` as the path into the `PDFNetC` folder that you extracted.**

{% tabs %}
{% tab title="Shell" %}
{% code lineNumbers="true" %}

```sh
PDFNET_BASE = path/to/extraction/folder/PDFNetC64UWP/
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Run the samples

Navigate to the location of extracted contents. Find and enter the `Samples` folder (`PDFNET_BASE/Samples`). Here you can find sample code for a large number of features supported by the Apryse SDK.

Find `Samples_VC20XX.sln` inside the `Samples` folder and open it with Visual Studio. Choose the appropriate solution based on your Visual Studio installation.

**Run a specific sample**

1. Find the sample you want to run and set it as the Startup project.If you're running into issues, see the [Troubleshooting](#troubleshooting) section.
2. Run the project.

**Run all samples**

1. Make sure that the target type for the debugger is set to the right type for your machine and your Apryse SDK Download. Click on Local Windows Debugger to run all the samples.

![](https://3246663708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Frgmys2szYV2Z567Zu3vi%2Fuploads%2Fgit-blob-7849f05c531dddb6f85b463e6305e1ccf48db9ea%2F376b4faabe347792eae9fa0e3b3149a96b4469db-1086x156.png?alt=media)

Note: For ARM64 target it will be necessary to setup the Remote Debugger.

## Integrate into your application

This section will help you build the "Apryse Hello World" application. It is easy to integrate the rest of Apryse SDK if you are able to open, save and close a PDFDoc.

Before writing the application, some dependencies needed to be with Visual Studio.

1. Create a new C++ Console Project for Windows called `myapp`
2. Add `PDFNET_BASE\Lib\PDFNetC.lib` to Additional Dependencies under Librarian
3. Add `PDFNET_BASE\Headers` to the project's Additional Include Directories in the C/C++ General Settings.
4. Copy the `PDFNET_BASE\Lib\PDFNetC.dll` file to the project's output directory. Verify that the right version of PDFNetC.dll was added from the path used to add the reference.

The [Troubleshooting](#troubleshooting) section has more detailed instructions for newcomers to Visual Studio.

### The Code

Replace the contents of `myapp.cpp` with:

{% code lineNumbers="true" %}

```
```

{% endcode %}

````sh
``` cpp

#include <iostream>

// Important for PDF related manipulations
#include <PDF/PDFNet.h>
#include <PDF/PDFDoc.h>

// Important for document filesystem interaction and more
#include <SDF/ObjSet.h>

using namespace pdftron;
using namespace PDF;
using namespace SDF;


int main()
{
    try
    {
        // This is required before any Apryse related 
        // classes and methods can be properly used
        PDFNet::Initialize();

        PDFDoc doc;

        // Create a new page and push it into
        // the page sequence of the document.
        Page page = doc.PageCreate();
        doc.PagePushBack(page);

        // Save the document as a linearized PDF which is the most
        // popular and effective fast viewing format
        doc.Save("linearized_output.pdf", SDFDoc::e_linearized);
    }
    catch (pdftron::Common::Exception& ex)
    {
        std::cout << ex.GetMessage() << std::endl;
    }
    return 0;
}
````

{% endcode %} {% endtab %} {% endtabs %}

```

You can use the `Local Windows Debugger` button to build the solution and run the main function when targeting x64.

Once the code has been run, you can find a new document called `linearized_output.pdf` in the output directory of your project.

## Troubleshooting

[Trouble setting dependencies](https://app.gitbook.com/s/ziw3GiL98Xfj63F3He8h/get-started/faq/set-dependencies-with-visual-studio-cpp)
Set dependencies for the Apryse SDK in a startup project with Visual Studio.
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/uwp/get-started/integration/pdfnetcuwp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
