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 Unknown = 0,
95 Unkwnon = 0,
96 Failed,
97 User,
98 Owner,
99};
100
101class PdfEncryptContext;
102
112class PODOFO_API PdfEncrypt
113{
114 friend class PdfEncryptMD5Base;
115 friend class PdfEncryptAESV3;
116 PODOFO_PRIVATE_FRIEND(class PdfEncryptSession);
117
118public:
119 virtual ~PdfEncrypt();
120
134 static std::unique_ptr<PdfEncrypt> Create(const std::string_view& userPassword,
135 const std::string_view& ownerPassword,
136 PdfPermissions protection = PdfPermissions::Default,
137 PdfEncryptionAlgorithm algorithm = PdfEncryptionAlgorithm::AESV3R6,
138 PdfKeyLength keyLength = PdfKeyLength::Unknown);
139
150 static std::unique_ptr<PdfEncrypt> CreateFromObject(const PdfObject& obj);
151
161 static PdfEncryptionAlgorithm GetEnabledEncryptionAlgorithms();
162
168 static bool IsEncryptionEnabled(PdfEncryptionAlgorithm algorithm);
169
174 void EnsureEncryptionInitialized(const PdfString& documentId, PdfEncryptContext& context);
175
183 void Authenticate(const std::string_view& password, const PdfString& documentId, PdfEncryptContext& context) const;
184
192
204 virtual std::unique_ptr<InputStream> CreateEncryptionInputStream(InputStream& inputStream, size_t inputLen,
205 PdfEncryptContext& context, const PdfReference& objref) const = 0;
206
217 virtual std::unique_ptr<OutputStream> CreateEncryptionOutputStream(OutputStream& outputStream,
218 PdfEncryptContext& context, const PdfReference& objref) const = 0;
219
222 inline PdfEncryptionAlgorithm GetEncryptAlgorithm() const { return m_Algorithm; }
223
232 bool IsOwnerPasswordSet() const;
233
240 bool IsPrintAllowed() const;
241
248 bool IsEditAllowed() const;
249
256 bool IsCopyAllowed() const;
257
264 bool IsEditNotesAllowed() const;
265
272 bool IsFillAndSignAllowed() const;
273
280 bool IsAccessibilityAllowed() const;
281
288 bool IsDocAssemblyAllowed() const;
289
296 bool IsHighPrintAllowed() const;
297
299 void EncryptTo(charbuff& out, const bufferview& view, PdfEncryptContext& context, const PdfReference& objref) const;
300
302 void DecryptTo(charbuff& out, const bufferview& view, PdfEncryptContext& context, const PdfReference& objref) const;
303
306 virtual size_t CalculateStreamLength(size_t length) const = 0;
307
309 virtual size_t CalculateStreamOffset() const = 0;
310
313 unsigned GetKeyLengthBytes() const;
314
316 bufferview GetUValue() const;
317
319 bufferview GetOValue() const;
320
321public:
323 PdfKeyLength GetKeyLength() const { return m_KeyLength; }
324
326 inline PdfPermissions GetPValue() const { return m_pValue; }
327
329 inline unsigned GetRevision() const { return m_rValue; }
330
331 inline bool IsMetadataEncrypted() const { return m_EncryptMetadata; }
332
333 inline bool IsParsed() const { return m_IsParsed; }
334
335protected:
336 inline const unsigned char* GetUValueRaw() const { return m_uValue; }
337
338 inline const unsigned char* GetOValueRaw() const { return m_oValue; }
339
340 inline const std::string& GetUserPassword() const { return m_userPass; }
341
342 inline const std::string& GetOwnerPassword() const { return m_ownerPass; }
343
344 int64_t GetPValueForSerialization() const;
345
346protected:
348 void InitFromValues(PdfEncryptionAlgorithm algorithm, PdfKeyLength keyLength, unsigned char revision,
349 PdfPermissions pValue, const bufferview& uValue, const bufferview& oValue,
350 bool encryptedMetadata);
351
354 void InitFromScratch(const std::string_view& userPassword, const std::string_view& ownerPassword,
355 PdfEncryptionAlgorithm algorithm, PdfKeyLength keyLength, unsigned char revision,
356 PdfPermissions pValue, bool encryptedMetadata);
357
358 virtual void Decrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
359 const PdfReference& objref, char* outStr, size_t& outLen) const = 0;
360
361 virtual void Encrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
362 const PdfReference& objref, char* outStr, size_t outLen) const = 0;
363
364 virtual PdfAuthResult Authenticate(const std::string_view& password, const std::string_view& documentId,
365 PODOFO_CRYPT_CTX* ctx, unsigned char encryptionKey[32]) const = 0;
366
367 virtual void GenerateEncryptionKey(
368 const std::string_view& documentId, PdfAuthResult authResult, PODOFO_CRYPT_CTX* ctx,
369 unsigned char uValue[48], unsigned char oValue[48], unsigned char encryptionKey[32]) = 0;
370
371 // Check two keys for equality
372 bool CheckKey(const unsigned char key1[32], const unsigned char key2[32]) const;
373
374 enum class PdfRC4Revision : uint8_t
375 {
376 R2 = 2,
377 R3 = 3,
378 };
379
380 enum class PdfAESV3Revision : uint8_t
381 {
382 R5 = 5,
383 R6 = 6,
384 };
385
386private:
387 PdfEncrypt();
388
389 PdfEncrypt(const PdfEncrypt& rhs) = default;
390
391 PdfEncrypt& operator=(PdfEncrypt& rhs) = delete;
392
393private:
394 static std::unique_ptr<PdfEncrypt> CreateFromEncrypt(const PdfEncrypt& rhs);
395
396 void clearSensitiveInfo();
397
398private:
399 PdfEncryptionAlgorithm m_Algorithm; // The used encryption algorithm
400 unsigned char m_rValue; // Revision
401 PdfKeyLength m_KeyLength; // The encryption key length, as enum value
402 PdfPermissions m_pValue; // P entry in pdf document
403 unsigned char m_uValue[48]; // U entry in pdf document
404 unsigned char m_oValue[48]; // O entry in pdf document
405 unsigned char m_uValueSize;
406 unsigned char m_oValueSize;
407 bool m_EncryptMetadata; // Is metadata encrypted
408 bool m_IsParsed; // True if the object is created from parsed values
409 bool m_initialized; // True if the object O/U values were filled
410 std::string m_userPass; // User password
411 std::string m_ownerPass; // Owner password
412
413};
414
415class PODOFO_API PdfEncryptContext final
416{
417 friend class PdfEncrypt;
418 friend class PdfEncryptRC4;
419 friend class PdfEncryptAESV2;
420 friend class PdfEncryptAESV3;
421
422public:
423 PdfEncryptContext();
424
425 ~PdfEncryptContext();
426
427 PdfEncryptContext(const PdfEncryptContext&);
428
429 PdfEncryptContext& operator=(const PdfEncryptContext&);
430
431public:
432 inline PdfAuthResult GetAuthResult() { return m_AuthResult; }
433
434 inline const std::string GetDocumentId() { return m_documentId; }
435
436 bool IsAuthenticated() const;
437
438private:
439 inline const unsigned char* GetEncryptionKey() const { return m_encryptionKey; }
440
441 PODOFO_CRYPT_CTX* GetCryptCtx();
442
443 template <typename T>
444 T& GetCustomCtx()
445 {
446 if (m_customCtx == nullptr)
447 {
448 m_customCtx = ::operator new(sizeof(T));
449 m_customCtxSize = sizeof(T);
450 }
451
452 return *(T*)m_customCtx;
453 }
454
455private:
456 unsigned char m_encryptionKey[32]; // Encryption key
457 std::string m_documentId; // DocumentID of the current document
458 PdfAuthResult m_AuthResult;
459 PODOFO_CRYPT_CTX* m_cryptCtx;
460 void* m_customCtx;
461 size_t m_customCtxSize;
462};
463
464
472{
473 friend class PdfEncryptRC4;
474 friend class PdfEncryptAESV2;
475
476private:
478
480
481public:
483
484 // NOTE: We must declare again without body otherwise the other Authenticate overload hides it
485 PdfAuthResult Authenticate(const std::string_view& password, const std::string_view& documentId,
486 PODOFO_CRYPT_CTX* ctx, unsigned char encryptionKey[32]) const override = 0;
487
488protected:
489 // Compute owner key
490 static void ComputeOwnerKey(const unsigned char userPad[32], const unsigned char ownerPad[32],
491 unsigned keylength, unsigned revision, bool authenticate, PODOFO_CRYPT_CTX* ctx, unsigned char ownerKey[32]);
492
493 // Pad a password to 32 characters
494 static void PadPassword(const std::string_view& password, unsigned char pswd[32]);
495
496 // Compute encryption key and user key
497 static void ComputeEncryptionKey(const std::string_view& documentID,
498 const unsigned char userPad[32], const unsigned char ownerKey[32],
499 PdfPermissions pValue, unsigned keyLength, unsigned revision,
500 bool encryptMetadata, PODOFO_CRYPT_CTX* ctx,
501 unsigned char userKey[32], unsigned char encryptionKey[32]);
502
507 void CreateObjKey(unsigned char objkey[16], unsigned& pnKeyLen,
508 const unsigned char m_encryptionKey[32], const PdfReference& objref) const;
509};
510
517{
518 friend class PdfEncrypt;
519
520private:
522 PdfEncryptAESV2(const std::string_view& userPassword, const std::string_view& ownerPassword,
525
526public:
527 std::unique_ptr<InputStream> CreateEncryptionInputStream(InputStream& inputStream, size_t inputLen,
528 PdfEncryptContext& context, const PdfReference& objref) const override;
529 std::unique_ptr<OutputStream> CreateEncryptionOutputStream(OutputStream& outputStream,
530 PdfEncryptContext& context, const PdfReference& objref) const override;
531
532 size_t CalculateStreamOffset() const override;
533
534 size_t CalculateStreamLength(size_t length) const override;
535
536protected:
537 void Encrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
538 const PdfReference& objref, char* outStr, size_t outLen) const override;
539 void Decrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
540 const PdfReference& objref, char* outStr, size_t& outLen) const override;
541
542 void GenerateEncryptionKey(const std::string_view& documentId, PdfAuthResult authResult, PODOFO_CRYPT_CTX* ctx,
543 unsigned char uValue[48], unsigned char oValue[48], unsigned char encryptionKey[32]) override;
544
545 PdfAuthResult Authenticate(const std::string_view& password, const std::string_view& documentId,
546 PODOFO_CRYPT_CTX* ctx, unsigned char encryptionKey[32]) const override;
547
548private:
549 void generateInitialVector(const std::string_view& documentId, unsigned char iv[]) const;
550};
551
558{
559 friend class PdfEncrypt;
560
561private:
563 PdfPermissions pValue, PdfString permsValue, PdfAESV3Revision rev);
564 PdfEncryptAESV3(const std::string_view& userPassword, const std::string_view& ownerPassword,
565 PdfAESV3Revision rev, PdfPermissions protection);
567
568public:
569 std::unique_ptr<InputStream> CreateEncryptionInputStream(InputStream& inputStream, size_t inputLen,
570 PdfEncryptContext& context, const PdfReference& objref) const override;
571 std::unique_ptr<OutputStream> CreateEncryptionOutputStream(OutputStream& outputStream,
572 PdfEncryptContext& context, const PdfReference& objref) const override;
573
574 size_t CalculateStreamOffset() const override;
575
576 size_t CalculateStreamLength(size_t length) const override;
577
579
580 // Get the UE object value (user)
581 bufferview GetUEValue() const;
582
583 // Get the OE object value (owner)
584 bufferview GetOEValue() const;
585
586 // Get the Perms object value (encrypted protection)
587 bufferview GetPermsValue() const;
588
589protected:
590 // Encrypt a character string
591 void Encrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
592 const PdfReference& objref, char* outStr, size_t outLen) const override;
593 void Decrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
594 const PdfReference& objref, char* outStr, size_t& outLen) const override;
595
596 PdfAuthResult Authenticate(const std::string_view& password, const std::string_view& documentId,
597 PODOFO_CRYPT_CTX* ctx, unsigned char encryptionKey[32]) const override;
598
599 void GenerateEncryptionKey(const std::string_view& documentId, PdfAuthResult authResult, PODOFO_CRYPT_CTX* ctx,
600 unsigned char uValue[48], unsigned char oValue[48], unsigned char encryptionKey[32]) override;
601
602private:
603 // Generate initial vector
604 static void generateInitialVector(unsigned char iv[]);
605
606 // Preprocess password for use in EAS-256 Algorithm
607 // outBuf needs to be at least 127 bytes long
608 static void preprocessPassword(const std::string_view& password, unsigned char* outBuf, unsigned& len);
609
610 // Compute encryption key to be used with AES-256
611 static void computeEncryptionKey(unsigned keyLength, unsigned char encryptionKey[32]);
612
613 // Compute hash for password and salt with optional uValue
614 static void computeHash(const unsigned char* pswd, unsigned pswdLen, unsigned revision,
615 const unsigned char salt[8], const unsigned char uValue[48], unsigned char hashValue[32]);
616
617 // Generate the U and UE entries
618 static void computeUserKey(const unsigned char* userpswd, unsigned len, unsigned revision,
619 unsigned keyLength, const unsigned char encryptionKey[32],
620 unsigned char uValue[48], unsigned char ueValue[32]);
621
622 // Generate the O and OE entries
623 static void computeOwnerKey(const unsigned char* userpswd, unsigned len, unsigned revision,
624 unsigned keyLength, const unsigned char encryptionKey[32], const unsigned char uValue[48],
625 unsigned char oValue[48], unsigned char oeValue[32]);
626
627private:
628 unsigned char m_ueValue[32]; // UE entry in pdf document
629 unsigned char m_oeValue[32]; // OE entry in pdf document
630 unsigned char m_permsValue[16]; // Perms entry in pdf document
631};
632
639{
640 friend class PdfEncrypt;
641
642private:
645 unsigned keyLength, bool encryptMetadata);
646 PdfEncryptRC4(const std::string_view& userPassword, const std::string_view& ownerPassword,
650 PdfEncryptRC4(const PdfEncryptRC4& rhs) = default;
651
652public:
653 std::unique_ptr<InputStream> CreateEncryptionInputStream(InputStream& inputStream, size_t inputLen,
654 PdfEncryptContext& context, const PdfReference& objref) const override;
655
656 std::unique_ptr<OutputStream> CreateEncryptionOutputStream(OutputStream& outputStream,
657 PdfEncryptContext& context, const PdfReference& objref) const override;
658
659 size_t CalculateStreamOffset() const override;
660
661 size_t CalculateStreamLength(size_t length) const override;
662
663protected:
664 void Encrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
665 const PdfReference& objref, char* outStr, size_t outLen) const override;
666
667 void Decrypt(const char* inStr, size_t inLen, PdfEncryptContext& context,
668 const PdfReference& objref, char* outStr, size_t& outLen) const override;
669
670 void GenerateEncryptionKey(const std::string_view& documentId, PdfAuthResult authResult, PODOFO_CRYPT_CTX* ctx,
671 unsigned char uValue[48], unsigned char oValue[48], unsigned char encryptionKey[32]) override;
672
673 PdfAuthResult Authenticate(const std::string_view& password, const std::string_view& documentId,
674 PODOFO_CRYPT_CTX* ctx, unsigned char encryptionKey[32]) const override;
675
676private:
677 static unsigned normalizeKeyLength(unsigned keyLength);
678};
679
680}
681ENABLE_BITMASK_OPERATORS(PoDoFo::PdfPermissions);
682ENABLE_BITMASK_OPERATORS(PoDoFo::PdfEncryptionAlgorithm);
683
684#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:517
size_t CalculateStreamLength(size_t length) const override
Calculate stream size.
Definition PdfEncrypt.cpp:1377
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:1395
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:1386
size_t CalculateStreamOffset() const override
Calculate stream offset.
Definition PdfEncrypt.cpp:1318
A class that is used to encrypt a PDF file (AES-256)
Definition PdfEncrypt.h:558
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:1917
size_t CalculateStreamLength(size_t length) const override
Calculate stream size.
Definition PdfEncrypt.cpp:1908
void CreateEncryptionDictionary(PdfDictionary &dictionary) const override
Fill all keys into a encryption dictionary.
Definition PdfEncrypt.cpp:1622
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:1924
size_t CalculateStreamOffset() const override
Calculate stream offset.
Definition PdfEncrypt.cpp:1828
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:472
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:886
void CreateEncryptionDictionary(PdfDictionary &dictionary) const override
Fill all keys into a encryption dictionary.
Definition PdfEncrypt.cpp:957
A class that is used to encrypt a PDF file (RC4 40-bit and 128-bit)
Definition PdfEncrypt.h:639
size_t CalculateStreamOffset() const override
Calculate stream offset.
Definition PdfEncrypt.cpp:1072
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:1188
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:1098
size_t CalculateStreamLength(size_t length) const override
Calculate stream size.
Definition PdfEncrypt.cpp:1077
A class that is used to encrypt a PDF file and set document permissions on the PDF file.
Definition PdfEncrypt.h:113
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:329
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:326
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:323
PdfEncryptionAlgorithm GetEncryptAlgorithm() const
Get the encryption algorithm of this object.
Definition PdfEncrypt.h:222
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.