PDF Export Dialog

I am using PDFExport and setting the file name programatically. I do not want to display the export dialog, so I have set it to false in PDFExport. It suppresses the dialog, but then it doesn't actually save the pdf. I just want to export with no prompt, but it doesn't work.

Comments

  • edited 2:32AM
    It does work. Consider this code:
    procedure ExportReport(Input, Output: string);
    var
      Exp: TfrxPDFExport;
      Rep: TfrxReport;
    begin
      Rep := TfrxReport.Create(nil);
      Exp := TfrxPDFExport.Create(nil);
    
      try
        if ExtractFileExt(Input) = '.fp3' then
          Rep.PreviewPages.LoadFromFile(Input)
        else
        begin
          Rep.LoadFromFile(Input);
          Rep.PrepareReport;
        end;
    
        Exp.FileName      := Output;
        Exp.ShowDialog    := False;
        Exp.ShowProgress  := False;
    
        Rep.Export(Exp);
      finally
        Rep.Free;
        Exp.Free;
      end;
    end;
    
  • edited 2:32AM
    Thank you, Draeden
    The code is work for me.
    Besides, I want to extract text from PDF and split PDF file, do you have any good ideas on it? I'm lacking of experience on it.

Leave a Comment