Topic: PDF Export Properties

Hi Dimtry,


at the PDF Export you can set manual some of the PDF Properties and Security settings, etc.


Is it possible to do it by script or any other presetting and blocking manual changings? Mostly interesting for Title, Author, Subject, Keywords, Creator and Producer.


Since you can read out the MAC ID it would be nice to have some fun with this. Like using MAC ID for Creater Identification and Producer setting for some advertising with each exported PDF File.

Post's attachments

Attachment icon MyVisualDatabase-Fastreport-PDFExport.png 16.53 kb, 302 downloads since 2017-11-23 

Re: PDF Export Properties

Hello.


Check it out

procedure Form1_bReport_OnClick (Sender: TObject; var Cancel: boolean);
begin
    Form1.frxPDFExport1.Title := 'Iam';
    Form1.frxPDFExport1.Author := 'Iam';
    Form1.frxPDFExport1.Subject := 'Iam';
    Form1.frxPDFExport1.Keywords := 'Iam';
    Form1.frxPDFExport1.Creator := 'Iam';
    Form1.frxPDFExport1.CreationTime := now;
    Form1.frxPDFExport1.Producer := 'Iam';
    Form1.frxPDFExport1.OwnerPassword := 'password';

end;

procedure Form1_bReport_OnAfterClick (Sender: string);
var
    sFile: string;
    sDest: string;
    sUser: string;
begin
    sUser := 'admin';
    sFile := Form1.frxPDFExport1.FileName;
                                                


    sDest := 'd:\Report\'+FormatDateTime('YYYY-MM-DD', now)+'\'+sUser+'\';
    if ForceDirectories(sDest) then
    begin
        CopyFile(sFile, sDest+'doc.pdf');
        OpenFile(sDest+'doc.pdf'); // if you want open file
    end;

    DeleteFile(sFile);
    Form1.frxPDFExport1.OwnerPassword := '';
end;

begin
    Form1.frxPDFExport1.OpenAfterExport := False;
end.
Dmitry.