Embed Annotations into PDFs in UWP
By default, when exporting a PDF document, PSPDFKit for Windows saves all annotations of the exported document to the same PDF file. This means you don’t have to do any extra work to embed the annotations into files.
The following snippet exports a file to a local folder chosen by the user, but the annotation embedding behavior is the same for any exporting method you choose:
var file = PDFView.Document.DocumentSource.GetFile(); await PDFView.Document.ExportAsync(file);
After the file is saved, the annotations will appear and be editable as expected when opening the document in other PDF viewing applications. Embedding annotations into a PDF is especially helpful for scenarios where the document is shared, as all users will be able to see the same annotations.
However, there are some use cases where you need to save and store annotations outside the PDF file — say in a database. Refer to our guide about saving and storing annotations to external storage for more details. Moreover, you might also want to flatten the annotations, meaning that they only appear visually on the document and can’t be interacted with or changed. To learn more about this, see our flattening annotations guide.
Finally, for more information on exporting files, refer to our guides on saving files.