Some test text!

Hamburger Icon

UWP / Guides / Save a document

Saving documents in UWP

Use Apryse's saving APIs from PDFDoc class to save PDF documents on local storage.

Saving by path

To save a PDF document to path use:

pdfdoc.SaveAsync(filepath, SDFDocSaveOptions...);

For example, to save for optimized file streaming, use:

pdfdoc.SaveAsync(filepath, SDFDocSaveOptions.e_linearized);

Saving modes

There are a few ways to save a PDF document on permanent storage such as save with remove unused objects, save incrementally, save in linearized format, etc.

Save with remove unused objects SDFDocSaveOptions.e_remove_unused

This mode saves disk storage space by rearranging the PDF document and removing unused objects. As a result, the output file can be significantly smaller. However, the saving process itself may take longer compared to incremental mode.

Save incrementally SDFDocSaveOptions.e_incremental

Use the incremental mode if you are particularly concerned about the time it takes to save the file. If you use this mode, any changes to the document, even the deletion of annotations, will be appended to the end of the PDF file. Note that it is not possible to incrementally save the document if the underlying file has an XRef table that had to be repaired when the file was opened (see!msg/pdfnet-sdk/GZwt_U16ipw/zhq43GQnNlYJ).

Save in linearized format SDFDocSaveOptions.e_linearized

This mode is to be preferentially used in file streaming situations, such as when you want to upload a PDF document. A linearized PDF file is a PDF file that is structured in a way that allows the first page of the PDF file to be displayed in a user's device before the entire file is downloaded from the Web server. If you're developing a system that creates large PDF files for delivery to client, you should try to make sure that your system can generate linearized PDF files. Your users might become frustrated and impatient if your system creates large PDF files that are not linearized, because it could take 30 seconds or even longer for a user's device to display a large PDF file that is not linearized. PDF linearization is also know as 'fast web view'.

Read & write a PDF file from/to memory buffer
Full source code which illustrates how to read/write a PDF document from/to memory buffer. This is useful for applications that work with dynamic PDF documents that don't need to be saved/read from a disk.

Get the answers you need: Chat with us