Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TMS mCL
Merging multiple PDF documents with TMSFMXNativeMacPDFLib

The code below shows how to input and merge multiple PDF documents to a single PDF document.
var
  input: TStringList;
  output: String;
  I, J: Integer;
begin
  input := TStringList.Create;
  input.Add(ExtractFilePath(ParamStr(0)) + 'Egypt.pdf');
  input.Add(ExtractFilePath(ParamStr(0)) + 'BoraBora.pdf');
  input.Add(ExtractFilePath(ParamStr(0)) + 'London.pdf');

  output := TPath.GetDocumentsPath + '/Merged.pdf';
  TMSFMXNativeMacPDFLib1.BeginDocument(output);
  for I := 0 to input.Count - 1 do
  begin
    TMSFMXNativeMacPDFLib1.OpenDocument(input[I]);
    for J := 1 to TMSFMXNativePDFLib1.GetPageCount do
    begin
      TMSFMXNativeMacPDFLib1.GetPageInfo(J);
      TMSFMXNativeMacPDFLib1.NewPage;
      TMSFMXNativeMacPDFLib1.DrawPage(J);
    end;
    TMSFMXNativeMacPDFLib1.CloseDocument;
  end;
  TMSFMXNativeMacPDFLib1.EndDocument;

  input.Free;
end;