#1 Re: PDF Engine » How to export from QuickReport in a pdf file encrypted? » 2014-08-11 08:17:28

Doc := TPdfDocument.Create(false,0,false,TPdfEncryption.New(elRC4_128,'password.open','password.protection',PDF_PERMISSION_NOCOPYNORPRINT));

Very well!
Thanks,
Tiziano

#2 Re: PDF Engine » How to export from QuickReport in a pdf file encrypted? » 2014-08-09 10:22:25

Last question: how do you put password permission to the opening of the pdf?
Tiz.

#3 Re: PDF Engine » How to export from QuickReport in a pdf file encrypted? » 2014-08-09 10:16:10

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

#4 Re: PDF Engine » How to export from QuickReport in a pdf file encrypted? » 2014-08-09 08:12:46

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

#5 PDF Engine » How to export from QuickReport in a pdf file encrypted? » 2014-08-08 17:06:52

stefanti
Replies: 7

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

#6 Re: PDF Engine » bswap32(..): undeclared identifier ? » 2014-08-08 16:17:43

ab wrote:

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

#7 PDF Engine » bswap32(..): undeclared identifier ? » 2014-08-08 15:08:34

stefanti
Replies: 2

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

Board footer

Powered by FluxBB