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 8:22PM
    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 8:22PM
    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

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.