Delphi - Join PDF files

Asked

Viewed 503 times

-1

I need the following process to be able to join some PDF files.

procedure Tservermain.reportmaster_relatorioReports(Sender: TObject);
 begin
  with reportmaster_relatorio.Reports do
   begin
    Add(RelatorioCapa.QuickRep1);
    Add(RelatorioInfo.QuickRep1);
    Add(RelatorioConclusao.QuickRep1);

   end;
end;

Currently it joins the various pages and creates this report, but now I need it to add 2 more PDF sheets.

Thank you!

PS: I’ve been testing this way:

Add(Caminho + '\PDF\' + 'Doc1.pdf');

And gave the following error: E2010 Incompatible types: 'Pointer' and 'Shortstring'

  • which libraries/technologies you are using to generate this PDF, this would be the generation of a report?

1 answer

0

You can use a third party component for this purpose, here we use the Gnostice Pdftoolkit

To merge is something like...

var
  vArquivos: TStringList;
begin
  vArquivos := TStringList.Create;
  vArquivos.Add(arquivo_entrada..);
  vArquivos.Add(arquivo_entrada..);

  PDFDocument.MergeDocs(vArquivos);
  PDFDocument.SaveToFile(arquivo_saida);

  FreeAndNil(vArquivos);
end;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.