Examples in this group show how to work with password protected PDFs (access their properties,
make modifications, add annotations etc.) without specifying the password.
But please keep in mind the following inherent restrictions in such scenarios:
You cannot read/write properties based on PDF string objects, typically those are string properties (e.g. DocumentInfo.Creator).
You cannot read/write stream objects, some of the operations that are not supported because they depend on PDF streams are:
Rendering PDF pages.
Adding or changing page content.
Embedding fonts.
Creating or editing annotation appearance streams.
PDF files may contain "object streams". An object stream is a stream object in which a sequence of indirect objects may be stored,
as an alternative to their being stored at the outermost file level. In an encrypted PDF the object stream will be encrypted too,
so PDF objects in it will not be accessible, as the result PDF files using object streams cannot be opened without knowing the password at all,
an exception will be thrown.
Operations that can be performed on a password protected PDF without specifying the password include:
Reading/writing properties that are not based on PDF strings or streams.
Adding new objects that can be defined without the use of PDF strings or streams.
Note also that most of these examples will not work in an unlicensed version of DsPdf, due to the no license limitations (the 5 page load limit and the adding of the nag text).
Some useful scenarios for working with password protected PDFs without passwords are demonstrated by the examples below.
For reference, all password protected PDFs in these demos have user password user and owner password owner.