Placeholder for topic body

program Encryption;

uses

SysUtils, Graphics, Classes, HPDFDoc;

 

var

HPDF: THotPDF;

 

begin

HPDF:= THotPDF.Create(nil);

try

HPDF.FileName :='Encrypt.pdf';              

HPDF.ActivateProtection := true;// Aktiver kryptering

HPDF.CryptKeyLength := k128;// Indstil krypteringstype til 128-bit

HPDF.OwnerPassword :='OwnerPass';                                // Indstil ejeradgangskode

HPDF.UserPassword :='UserPass';                                     // Indstil brugeradgangskode

    HPDF.ProtectOptions := [prPrint, prExtractContent];// Tillad brugeren at udtrække PDF-indhold

HPDF.BeginDoc;// Opret PDF-fil

HPDF.CurrentPage.TextOut(10, 10, 0, 'Encrypted document !!!'); // Udskriv tekst

HPDF.EndDoc;// Luk PDF-fil

finally

HPDF.Free;

end;

end