You are not logged in.
Pages: 1
Doc := TPdfDocument.Create(false,0,false,TPdfEncryption.New(elRC4_128,'password.open','password.protection',PDF_PERMISSION_NOCOPYNORPRINT));
Very well!
Thanks,
Tiziano
Last question: how do you put password permission to the opening of the pdf?
Tiz.
The solution you have provided to me in reading this:
http://synopse.info/forum/viewtopic.php?id=138
......
try
Doc := TPdfDocument.Create(false,0,false,TPdfEncryption.New(elRC4_128,'','toto',PDF_PERMISSION_NOCOPYNORPRINT));
Doc.DefaultPaperSize := psA4;
form2.QuickRep1.prepare;
for p := 1 to form2.QuickRep1.QRPrinter.PageCount do
begin
Doc.AddPage;
pagemeta := form2.QuickRep1.QRPrinter.PageList.GetPage(p);
try
Doc.Canvas.RenderMetaFile(pagemeta,1,0,0);
finally
pagemeta.free;
end;
end;
//This saves a pdf file encrypted by QuicReport
doc.SaveToFile('prova.pdf');
finally
doc.Free;
end;
Thanks !!!
Tiziano
procedure TForm1.test;
var
spdf : TQRSynPDFDocumentFilter;
doc: TPDFDocument;
begin
// 1) This creates a empty pdf file encrypted
Doc := TPdfDocument.Create(false,0,false,TPdfEncryption.New(elRC4_128,'','toto',PDF_PERMISSION_ALL));
// 2) This creates and saves a pdf file is not encrypted by QuicReport
spdf := TQRSynPDFDocumentFilter.Create('C:\test.pdf');
spdf.HideMenubar := true;
spdf.CompressionOn := true;
spdf.HideToolbar := true;
spdf.FontHandling := AutoEmbed;
form1.QuickRep1.ExportToFilter(spdf);
spdf.Free;
.....
?????
.....
end;
How do I connect the 1) with 2) in order to create and save a pdf file from QuickReport encrypted?
Thanks
Tiziano
I need to export to a pdf encrypted by QuickReport: I can create the pdf file is not encrypted using ExportToFilter but do not know how to export it directly encrypted.
How to ?
Thanks,
Tiziano
bswap32() is defined in SynCommons.pas.
I suspect your SynCrypto and SynCommons units are not in synch.
Please retrieve the latest versions from our source code repository.
You're absolutely right!
SynCrypto and SynCommons were not synchronized.
I've solved the problem, thank you very much,
Tiziano
Hi,
I'm trying to encrypt a PDF document by using SynCrypto but during compilation I get this error:
SynCrypto.pas: E2003 undeclared identifier: 'bswap32'.
In which Unit is definta this function?
I'm using Delphi XE2
Thanks
Tiziano
Pages: 1