#1 PDF Engine » Error Message when opening PDFs generated with synPDF. » 2018-07-17 16:54:44

ecptavares
Replies: 1

Hi!
I have made an application using Delphi and synPDF.I have a routine that exports some data to PDF with this code :

Var
  PDF : TPDFDocumentGDI;
  Page : TPDFPage;
  I,J : Integer;
  Senha : String;
begin
  Senha := 'CLINLIFE' + StringReplace(FormatDateTime('dd/MM/yyyy',Date),'/','',[rfReplaceAll]);

  PDF := TPDFDocumentGDI.Create(false,0,false,tpdfencryption.New(elRC4_40,Senha,'toto',PDF_PERMISSION_NOMODIF));
  I := 100;
  Try
    PDF.Info.Author := 'Eduardo Pinho Tavares';
    PDF.Info.CreationDate := Now;
    PDF.Info.Creator := 'Receitas CLINLIFE';
    PDF.Info.Subject := 'Receitas CLINLIFE';
    PDF.Info.Title := 'Receita da Clinlife';

    Page := PDF.AddPage;
    Page.PageLandscape := False;

    PDF.DefaultPaperSize := psA4;

    PDF.VCLCanvas.Font.Size := 12;
    PDF.VCLCanvas.Font.Style := [fsBold];
    PDF.VCLCanvas.TextOut(10,1,'Cliente : ' + Cliente);
    PDF.VCLCanvas.Font.Style := [fsItalic];
    PDF.VCLCanvas.TextOut(10,23,'Telefone : ' + Telefone + ' - Celular : ' + Celular);
    PDF.VCLCanvas.TextOut(10,45,'DATA : ' + FormatDateTime('dd/mm/yyyy',Date));
    PDF.VCLCanvas.Font.Size := 16;
    PDF.VCLCanvas.Font.Style := [];
    PDF.VCLCanvas.TextOut(10,I,':: RECEITAS CLINLIFE ::');

    PDF.VCLCanvas.Font.Size := 12;
    PDF.VCLCanvas.Font.Style := [fsItalic];

    for J := 0 to Texto.Lines.Count -1 do
      Begin
        I := I + 21;
        PDF.VCLCanvas.TextOut(15,I,Texto.Lines[J]);
      End;

    if PDF.SaveToFile(FileName) Then
     Begin
      Result := True;
      LogAtividade( 'Arquivo','Convertido para PDF');
     End
    Else
     Begin
       Result := False;
     End;
  Finally
    PDF.Free;
  End;
end;

I can open the PDFs just fine but the person I send these PDFs to she cant open.She gets a message "Maximum Tab Limit Reached" . What is this? She uses Adobe Reader to open those PDFs files.

Thank you very much!

Board footer

Powered by FluxBB