PoDoFo 1.2.0
Loading...
Searching...
No Matches
PdfEncrypt.h
1// SPDX-FileCopyrightText: 2006 Dominik Seichter <domseichter@web.de>
2// SPDX-FileCopyrightText: 2020 Francesco Pretto <ceztko@gmail.com>
3// SPDX-License-Identifier: LGPL-2.0-or-later OR MPL-2.0
4
5#ifndef PDF_ENCRYPT_H
6#define PDF_ENCRYPT_H
7
8#include "PdfString.h"
9#include "PdfReference.h"
10
11// Define an opaque type for the internal PoDoFo encryption context
12#ifndef PODOFO_CRYPT_CTX
13#define PODOFO_CRYPT_CTX void
14#endif // PODOFO_CRYPT_CTX
15
16namespace PoDoFo
17{
18
19class PdfDictionary;
20class InputStream;
21class PdfObject;
22class OutputStream;
23
24/* Class representing PDF encryption methods. (For internal use only)
25 * Based on code from Ulrich Telle: http://wxcode.sourceforge.net/components/wxpdfdoc/
26 * Original Copyright header:
27 * Name: pdfencrypt.h
28 * Purpose:
29 * Author: Ulrich Telle
30 * Modified by:
31 * Created: 2005-08-16
32 * Copyright: (c) Ulrich Telle
33 * Licence: wxWindows licence
34 */
35
38{
39 Unknown = 0,
40 L40 = 40,
41 L48 = 48,
42 L56 = 56,
43 L64 = 64,
44 L72 = 72,
45 L80 = 80,
46 L88 = 88,
47 L96 = 96,
48 L104 = 104,
49 L112 = 112,
50 L120 = 120,
51 L128 = 128,
52 L256 = 256
53};
54
56// ISO 32000-2:2020 7.6.4.2 "Standard encryption dictionary":
57// "The value of the P entry shall be interpreted as an unsigned
58// 32-bit quantity containing a set of flags."
60{
61 None = 0,
62 Print = 0x00000004,
63 Edit = 0x00000008,
64 Copy = 0x00000010,
65 EditNotes = 0x00000020,
66 FillAndSign = 0x00000100,
67 Accessible = 0x00000200,
68 DocAssembly = 0x00000400,
69 HighPrint = 0x00000800,
70 Default = Print
71 | Edit
72 | Copy
73 | EditNotes
77 | HighPrint
78};
79
82{
83 None = 0,
84 RC4V1 = 1,
85 RC4V2 = 2,
86 AESV2 = 4,
87 AESV3R5 = 8,
88 AESV3R6 = 16,
89};
90
92{
93 Unkwnon = 0,
94 Failed,
95 User,
96 Owner,
97};
98
99class PdfEncryptContext;
100
110class PODOFO_API PdfEncrypt
111{
112 friend class PdfEncryptMD5Base;
113 friend class PdfEncryptAESV3;
114 PODOFO_PRIVATE_FRIEND(class PdfEncryptSession);
115
116public:
117 virtual ~PdfEncrypt();
118
132 static std::unique_ptr<PdfEncrypt> Create(const std::string_view& userPassword,
133 const std::string_view& ownerPassword,
134 PdfPermissions protection = PdfPermissions::Default,
135 PdfEncryptionAlgorithm algorithm = PdfEncryptionAlgorithm::AESV3R6,
136 PdfKeyLength keyLength = PdfKeyLength::Unknown);
137
148 static std::unique_ptr<PdfEncrypt> CreateFromObject(const PdfObject& obj);
149
159 static PdfEncryptionAlgorithm GetEnabledEncryptionAlgorithms();
160
166 static bool IsEncryptionEnabled(PdfEncryptionAlgorithm algorithm);
167
172 void EnsureEncryptionInitialized(const PdfString& documentId, PdfEncryptContext& context);
173
181 void Authenticate(const std::string_view& password, const PdfString& documentId, PdfEncryptContext& context) const;
182
190
202 virtual std::unique_ptr<InputStream> CreateEncryptionInputStream(InputStream& inputStream, size_t inputLen,
203 PdfEncryptContext& context, const PdfReference& objref) const = 0;
204
215 virtual std::unique_ptr<OutputStream> CreateEncryptionOutputStream(OutputStream& outputStream,
216 PdfEncryptContext& context, const PdfReference& objref) const = 0;
217
220 inline PdfEncryptionAlgorithm GetEncryptAlgorithm() const { return m_Algorithm; }
221
230 bool IsOwnerPasswordSet() const;
231
238 bool IsPrintAllowed() const;
239
246 bool IsEditAllowed() const;
247
254 bool IsCopyAllowed() const;
255
262 bool IsEditNotesAllowed() const;
263
270 bool IsFillAndSignAllowed() const;
271
278 bool IsAccessibilityAllowed() const;
279
286 bool IsDocAssemblyAllowed() const;
287
294 bool IsHighPrintAllowed() const;
295
297 void EncryptTo(charbuff& out, const bufferview& view, PdfEncryptContext& context, const PdfReference& objref) const;
298
300 void DecryptTo(charbuff& out, const bufferview& view, PdfEncryptContext& context, const PdfReference& objref) const;
301
304 virtual size_t CalculateStreamLength(size_t length) const = 0;
305
307 virtual size_t CalculateStreamOffset() const = 0;
308
311 unsigned GetKeyLengthBytes() const;
312
314 bufferview GetUValue() const;
315
317 bufferview GetOValue() const;
318
319public:
321 PdfKeyLength GetKeyLength() const { return m_KeyLength; }
322
324 inline PdfPermissions GetPValue() const { return m_pValue; }
325
327 inline unsigned GetRevision() const { return m_rValue; }
328
329 inline bool IsMetadataEncrypted() const { return m_EncryptMetadata; }
330
331 inline bool IsParsed() const { return m_IsParsed; }
332
333protected:
334 inline const unsigned char* GetUValueRaw() const { return m_uValue; }
335
336 inline const unsigned char* GetOValueRaw() const { return m_oValue; }
337
338 inline const std::string& GetUserPassword() const { return m_userPass; }
339
340 inline const std::string& GetOwnerPassword() const { return m_ownerPass; }
341
342 int64_t GetPValueForSerialization() const;
343
344protected:
346 void InitFromValues(PdfEncryptionAlgorithm algorithm, PdfKeyLength keyLength, unsigned char revision,
347 PdfPermissions pValue, const bufferview& uValue, const bufferview& oValue,
348 bool encryptedMetadata);
349
352 void InitFromScratch(const std::string_view& userPassword, const std::string_view& ownerPassword,
353 PdfEncryptionAlgorithm algorithm, PdfKeyLength keyLength, unsigned char revision,
354 PdfPermissions pValue, bool encryptedMetadata);
355
356 virtual void Decrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
357 const PdfReference& objref, char* outStr, size_t& outLen) const = 0;
358
359 virtual void Encrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
360 const PdfReference& objref, char* outStr, size_t outLen) const = 0;
361
362 virtual PdfAuthResult Authenticate(const std::string_view& password, const std::string_view& documentId,
363 PODOFO_CRYPT_CTX* ctx, unsigned char encryptionKey[32]) const = 0;
364
365 virtual void GenerateEncryptionKey(
366 const std::string_view& documentId, PdfAuthResult authResult, PODOFO_CRYPT_CTX* ctx,
367 unsigned char uValue[48], unsigned char oValue[48], unsigned char encryptionKey[32]) = 0;
368
369 // Check two keys for equality
370 bool CheckKey(const unsigned char key1[32], const unsigned char key2[32]) const;
371
372 enum class PdfRC4Revision : uint8_t
373 {
374 R2 = 2,
375 R3 = 3,
376 };
377
378 enum class PdfAESV3Revision : uint8_t
379 {
380 R5 = 5,
381 R6 = 6,
382 };
383
384private:
385 PdfEncrypt();
386
387 PdfEncrypt(const PdfEncrypt& rhs) = default;
388
389 PdfEncrypt& operator=(PdfEncrypt& rhs) = delete;
390
391private:
392 static std::unique_ptr<PdfEncrypt> CreateFromEncrypt(const PdfEncrypt& rhs);
393
394 void clearSensitiveInfo();
395
396private:
397 PdfEncryptionAlgorithm m_Algorithm; // The used encryption algorithm
398 unsigned char m_rValue; // Revision
399 PdfKeyLength m_KeyLength; // The encryption key length, as enum value
400 PdfPermissions m_pValue; // P entry in pdf document
401 unsigned char m_uValue[48]; // U entry in pdf document
402 unsigned char m_oValue[48]; // O entry in pdf document
403 unsigned char m_uValueSize;
404 unsigned char m_oValueSize;
405 bool m_EncryptMetadata; // Is metadata encrypted
406 bool m_IsParsed; // True if the object is created from parsed values
407 bool m_initialized; // True if the object O/U values were filled
408 std::string m_userPass; // User password
409 std::string m_ownerPass; // Owner password
410
411};
412
413class PODOFO_API PdfEncryptContext final
414{
415 friend class PdfEncrypt;
416 friend class PdfEncryptRC4;
417 friend class PdfEncryptAESV2;
418 friend class PdfEncryptAESV3;
419
420public:
421 PdfEncryptContext();
422
423 ~PdfEncryptContext();
424
425 PdfEncryptContext(const PdfEncryptContext&);
426
427 PdfEncryptContext& operator=(const PdfEncryptContext&);
428
429public:
430 inline PdfAuthResult GetAuthResult() { return m_AuthResult; }
431
432 inline const std::string GetDocumentId() { return m_documentId; }
433
434 bool IsAuthenticated() const;
435
436private:
437 inline const unsigned char* GetEncryptionKey() const { return m_encryptionKey; }
438
439 PODOFO_CRYPT_CTX* GetCryptCtx();
440
441 template <typename T>
442 T& GetCustomCtx()
443 {
444 if (m_customCtx == nullptr)
445 {
446 m_customCtx = ::operator new(sizeof(T));
447 m_customCtxSize = sizeof(T);
448 }
449
450 return *(T*)m_customCtx;
451 }
452
453private:
454 unsigned char m_encryptionKey[32]; // Encryption key
455 std::string m_documentId; // DocumentID of the current document
456 PdfAuthResult m_AuthResult;
457 PODOFO_CRYPT_CTX* m_cryptCtx;
458 void* m_customCtx;
459 size_t m_customCtxSize;
460};
461
462
470{
471 friend class PdfEncryptRC4;
472 friend class PdfEncryptAESV2;
473
474private:
476
478
479public:
481
482 // NOTE: We must declare again without body otherwise the other Authenticate overload hides it
483 PdfAuthResult Authenticate(const std::string_view& password, const std::string_view& documentId,
484 PODOFO_CRYPT_CTX* ctx, unsigned char encryptionKey[32]) const override = 0;
485
486protected:
487 // Compute owner key
488 static void ComputeOwnerKey(const unsigned char userPad[32], const unsigned char ownerPad[32],
489 unsigned keylength, unsigned revision, bool authenticate, PODOFO_CRYPT_CTX* ctx, unsigned char ownerKey[32]);
490
491 // Pad a password to 32 characters
492 static void PadPassword(const std::string_view& password, unsigned char pswd[32]);
493
494 // Compute encryption key and user key
495 static void ComputeEncryptionKey(const std::string_view& documentID,
496 const unsigned char userPad[32], const unsigned char ownerKey[32],
497 PdfPermissions pValue, unsigned keyLength, unsigned revision,
498 bool encryptMetadata, PODOFO_CRYPT_CTX* ctx,
499 unsigned char userKey[32], unsigned char encryptionKey[32]);
500
505 void CreateObjKey(unsigned char objkey[16], unsigned& pnKeyLen,
506 const unsigned char m_encryptionKey[32], const PdfReference& objref) const;
507};
508
515{
516 friend class PdfEncrypt;
517
518private:
520 PdfEncryptAESV2(const std::string_view& userPassword, const std::string_view& ownerPassword,
523
524public:
525 std::unique_ptr<InputStream> CreateEncryptionInputStream(InputStream& inputStream, size_t inputLen,
526 PdfEncryptContext& context, const PdfReference& objref) const override;
527 std::unique_ptr<OutputStream> CreateEncryptionOutputStream(OutputStream& outputStream,
528 PdfEncryptContext& context, const PdfReference& objref) const override;
529
530 size_t CalculateStreamOffset() const override;
531
532 size_t CalculateStreamLength(size_t length) const override;
533
534protected:
535 void Encrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
536 const PdfReference& objref, char* outStr, size_t outLen) const override;
537 void Decrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
538 const PdfReference& objref, char* outStr, size_t& outLen) const override;
539
540 void GenerateEncryptionKey(const std::string_view& documentId, PdfAuthResult authResult, PODOFO_CRYPT_CTX* ctx,
541 unsigned char uValue[48], unsigned char oValue[48], unsigned char encryptionKey[32]) override;
542
543 PdfAuthResult Authenticate(const std::string_view& password, const std::string_view& documentId,
544 PODOFO_CRYPT_CTX* ctx, unsigned char encryptionKey[32]) const override;
545
546private:
547 void generateInitialVector(const std::string_view& documentId, unsigned char iv[]) const;
548};
549
556{
557 friend class PdfEncrypt;
558
559private:
561 PdfPermissions pValue, PdfString permsValue, PdfAESV3Revision rev);
562 PdfEncryptAESV3(const std::string_view& userPassword, const std::string_view& ownerPassword,
563 PdfAESV3Revision rev, PdfPermissions protection);
565
566public:
567 std::unique_ptr<InputStream> CreateEncryptionInputStream(InputStream& inputStream, size_t inputLen,
568 PdfEncryptContext& context, const PdfReference& objref) const override;
569 std::unique_ptr<OutputStream> CreateEncryptionOutputStream(OutputStream& outputStream,
570 PdfEncryptContext& context, const PdfReference& objref) const override;
571
572 size_t CalculateStreamOffset() const override;
573
574 size_t CalculateStreamLength(size_t length) const override;
575
577
578 // Get the UE object value (user)
579 bufferview GetUEValue() const;
580
581 // Get the OE object value (owner)
582 bufferview GetOEValue() const;
583
584 // Get the Perms object value (encrypted protection)
585 bufferview GetPermsValue() const;
586
587protected:
588 // Encrypt a character string
589 void Encrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
590 const PdfReference& objref, char* outStr, size_t outLen) const override;
591 void Decrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
592 const PdfReference& objref, char* outStr, size_t& outLen) const override;
593
594 PdfAuthResult Authenticate(const std::string_view& password, const std::string_view& documentId,
595 PODOFO_CRYPT_CTX* ctx, unsigned char encryptionKey[32]) const override;
596
597 void GenerateEncryptionKey(const std::string_view& documentId, PdfAuthResult authResult, PODOFO_CRYPT_CTX* ctx,
598 unsigned char uValue[48], unsigned char oValue[48], unsigned char encryptionKey[32]) override;
599
600private:
601 // Generate initial vector
602 static void generateInitialVector(unsigned char iv[]);
603
604 // Preprocess password for use in EAS-256 Algorithm
605 // outBuf needs to be at least 127 bytes long
606 static void preprocessPassword(const std::string_view& password, unsigned char* outBuf, unsigned& len);
607
608 // Compute encryption key to be used with AES-256
609 static void computeEncryptionKey(unsigned keyLength, unsigned char encryptionKey[32]);
610
611 // Compute hash for password and salt with optional uValue
612 static void computeHash(const unsigned char* pswd, unsigned pswdLen, unsigned revision,
613 const unsigned char salt[8], const unsigned char uValue[48], unsigned char hashValue[32]);
614
615 // Generate the U and UE entries
616 static void computeUserKey(const unsigned char* userpswd, unsigned len, unsigned revision,
617 unsigned keyLength, const unsigned char encryptionKey[32],
618 unsigned char uValue[48], unsigned char ueValue[32]);
619
620 // Generate the O and OE entries
621 static void computeOwnerKey(const unsigned char* userpswd, unsigned len, unsigned revision,
622 unsigned keyLength, const unsigned char encryptionKey[32], const unsigned char uValue[48],
623 unsigned char oValue[48], unsigned char oeValue[32]);
624
625private:
626 unsigned char m_ueValue[32]; // UE entry in pdf document
627 unsigned char m_oeValue[32]; // OE entry in pdf document
628 unsigned char m_permsValue[16]; // Perms entry in pdf document
629};
630
637{
638 friend class PdfEncrypt;
639
640private:
643 unsigned keyLength, bool encryptMetadata);
644 PdfEncryptRC4(const std::string_view& userPassword, const std::string_view& ownerPassword,
648 PdfEncryptRC4(const PdfEncryptRC4& rhs) = default;
649
650public:
651 std::unique_ptr<InputStream> CreateEncryptionInputStream(InputStream& inputStream, size_t inputLen,
652 PdfEncryptContext& context, const PdfReference& objref) const override;
653
654 std::unique_ptr<OutputStream> CreateEncryptionOutputStream(OutputStream& outputStream,
655 PdfEncryptContext& context, const PdfReference& objref) const override;
656
657 size_t CalculateStreamOffset() const override;
658
659 size_t CalculateStreamLength(size_t length) const override;
660
661protected:
662 void Encrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
663 const PdfReference& objref, char* outStr, size_t outLen) const override;
664
665 void Decrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
666 const PdfReference& objref, char* outStr, size_t& outLen) const override;
667
668 void GenerateEncryptionKey(const std::string_view& documentId, PdfAuthResult authResult, PODOFO_CRYPT_CTX* ctx,
669 unsigned char uValue[48], unsigned char oValue[48], unsigned char encryptionKey[32]) override;
670
671 PdfAuthResult Authenticate(const std::string_view& password, const std::string_view& documentId,
672 PODOFO_CRYPT_CTX* ctx, unsigned char encryptionKey[32]) const override;
673
674private:
675 static unsigned normalizeKeyLength(unsigned keyLength);
676};
677
678}
679ENABLE_BITMASK_OPERATORS(PoDoFo::PdfPermissions);
680ENABLE_BITMASK_OPERATORS(PoDoFo::PdfEncryptionAlgorithm);
681
682#endif // PDF_ENCRYPT_H
An interface for reading blocks of data from a data source.
Definition InputStream.h:17
An interface for writing blocks of data to a data source.
Definition OutputStream.h:15
The PDF dictionary data type of PoDoFo (inherits from PdfDataContainer, the base class for such repre...
Definition PdfDictionary.h:77
A class that is used to encrypt a PDF file (AES-128)
Definition PdfEncrypt.h:515
size_t CalculateStreamLength(size_t length) const override
Calculate stream size.
Definition PdfEncrypt.cpp:1380
std::unique_ptr< OutputStream > CreateEncryptionOutputStream(OutputStream &outputStream, PdfEncryptContext &context, const PdfReference &objref) const override
Create an OutputStream that encrypts all data written to it using the current settings of the PdfEncr...
Definition PdfEncrypt.cpp:1398
std::unique_ptr< InputStream > CreateEncryptionInputStream(InputStream &inputStream, size_t inputLen, PdfEncryptContext &context, const PdfReference &objref) const override
Create an InputStream that decrypts all data read from it using the current settings of the PdfEncryp...
Definition PdfEncrypt.cpp:1389
size_t CalculateStreamOffset() const override
Calculate stream offset.
Definition PdfEncrypt.cpp:1321
A class that is used to encrypt a PDF file (AES-256)
Definition PdfEncrypt.h:556
std::unique_ptr< InputStream > CreateEncryptionInputStream(InputStream &inputStream, size_t inputLen, PdfEncryptContext &context, const PdfReference &objref) const override
Create an InputStream that decrypts all data read from it using the current settings of the PdfEncryp...
Definition PdfEncrypt.cpp:1920
size_t CalculateStreamLength(size_t length) const override
Calculate stream size.
Definition PdfEncrypt.cpp:1911
void CreateEncryptionDictionary(PdfDictionary &dictionary) const override
Fill all keys into a encryption dictionary.
Definition PdfEncrypt.cpp:1625
std::unique_ptr< OutputStream > CreateEncryptionOutputStream(OutputStream &outputStream, PdfEncryptContext &context, const PdfReference &objref) const override
Create an OutputStream that encrypts all data written to it using the current settings of the PdfEncr...
Definition PdfEncrypt.cpp:1927
size_t CalculateStreamOffset() const override
Calculate stream offset.
Definition PdfEncrypt.cpp:1831
A pure virtual class that is used to encrypt a PDF file (RC4, AES-128) This class is the base for cla...
Definition PdfEncrypt.h:470
void CreateObjKey(unsigned char objkey[16], unsigned &pnKeyLen, const unsigned char m_encryptionKey[32], const PdfReference &objref) const
Create the encryption key for the current object.
Definition PdfEncrypt.cpp:889
void CreateEncryptionDictionary(PdfDictionary &dictionary) const override
Fill all keys into a encryption dictionary.
Definition PdfEncrypt.cpp:960
A class that is used to encrypt a PDF file (RC4 40-bit and 128-bit)
Definition PdfEncrypt.h:637
size_t CalculateStreamOffset() const override
Calculate stream offset.
Definition PdfEncrypt.cpp:1075
std::unique_ptr< OutputStream > CreateEncryptionOutputStream(OutputStream &outputStream, PdfEncryptContext &context, const PdfReference &objref) const override
Create an OutputStream that encrypts all data written to it using the current settings of the PdfEncr...
Definition PdfEncrypt.cpp:1191
std::unique_ptr< InputStream > CreateEncryptionInputStream(InputStream &inputStream, size_t inputLen, PdfEncryptContext &context, const PdfReference &objref) const override
Create an InputStream that decrypts all data read from it using the current settings of the PdfEncryp...
Definition PdfEncrypt.cpp:1101
size_t CalculateStreamLength(size_t length) const override
Calculate stream size.
Definition PdfEncrypt.cpp:1080
A bundle of the encrypt object together a context.
Definition PdfEncryptSession.h:13
A class that is used to encrypt a PDF file and set document permissions on the PDF file.
Definition PdfEncrypt.h:111
virtual size_t CalculateStreamLength(size_t length) const =0
Calculate stream size.
unsigned GetRevision() const
Get the revision number of the encryption method.
Definition PdfEncrypt.h:327
virtual size_t CalculateStreamOffset() const =0
Calculate stream offset.
virtual std::unique_ptr< OutputStream > CreateEncryptionOutputStream(OutputStream &outputStream, PdfEncryptContext &context, const PdfReference &objref) const =0
Create an OutputStream that encrypts all data written to it using the current settings of the PdfEncr...
void Authenticate(const std::string_view &password, const PdfString &documentId, PdfEncryptContext &context) const
Tries to authenticate a user using either the user or owner password.
virtual std::unique_ptr< InputStream > CreateEncryptionInputStream(InputStream &inputStream, size_t inputLen, PdfEncryptContext &context, const PdfReference &objref) const =0
Create an InputStream that decrypts all data read from it using the current settings of the PdfEncryp...
PdfPermissions GetPValue() const
Get the P object value (protection)
Definition PdfEncrypt.h:324
virtual void CreateEncryptionDictionary(PdfDictionary &dictionary) const =0
Fill all keys into a encryption dictionary.
PdfKeyLength GetKeyLength() const
Get the length of the encryption key in bits.
Definition PdfEncrypt.h:321
PdfEncryptionAlgorithm GetEncryptAlgorithm() const
Get the encryption algorithm of this object.
Definition PdfEncrypt.h:220
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:31
A reference is a pointer to a object in the PDF file of the form "4 0 R", where 4 is the object numbe...
Definition PdfReference.h:20
A string that can be written to a PDF document.
Definition PdfString.h:21
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:30
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13
PdfEncryptionAlgorithm
The encryption algorithm.
Definition PdfEncrypt.h:82
@ AESV3R5
AES encryption with a 256 bit key (PDF1.7 extension 3, deprecated in PDF 2.0)
@ AESV3R6
AES encryption with a 256 bit key, Revision 6 (PDF1.7 extension 8, PDF 2.0)
@ AESV2
AES encryption with a 128 bit key (PDF1.6)
@ RC4V1
RC4 Version 1 encryption using a 40bit key.
@ RC4V2
RC4 Version 2 encryption using a key with 40-128bit.
@ None
Do not add a default appearance.
@ Create
Create a new file or truncate existing one for writing/reading.
cspan< char > bufferview
Convenient read-only char buffer span.
Definition basetypes.h:15
PdfPermissions
Set user permissions/restrictions on a document.
Definition PdfEncrypt.h:60
@ FillAndSign
Fill in existing form or signature fields.
@ HighPrint
Print a high resolution version of the document.
@ Copy
Allow text and graphic extraction.
@ DocAssembly
Assemble the document: insert, create, rotate delete pages or add bookmarks.
@ Edit
Allow modifying the document besides annotations, form fields or changing pages.
@ EditNotes
Add or modify text annotations or form fields (if PdfPermissions::Edit is set also allow to create in...
@ Accessible
Extract text and graphics to support user with disabilities.
PdfKeyLength
A enum specifying a valid keylength for a PDF encryption key.
Definition PdfEncrypt.h:38
PdfAuthResult
Definition PdfEncrypt.h:92
@ User
Success authenticating a user for this PDF.
@ Owner
Success authenticating the owner for this PDF.
@ Failed
Failed to authenticate to this PDF.