WPTools Version 4

Top  Previous  Next

To export simply use the TWPDExport component.

 

Assign the property Source and execute 'Print'.

 

For the export from WPTools 4 the TWPRichText must use the property ScreenResMode = rmNormal and Zoom must be set to 100%.

Please use the ANSI DLL: wPDF400A.dll or wPDFDemo400A.dll.

 

 

This example exports into a memory stream and shows this stream in a WPViewPDF component.

 

var pdf : TWPPDFExport;

    mem : TMemoryStream;

    schema, desc : String;

    z : Integer;

begin

  pdf := TWPPDFExport.Create(nil);

  pdf.DLLName := ExtractFilePath(Application.ExeName) + 'wPDF400DEMOA.dll';

  mem := TMemoryStream.Create;

  try

 

    WPDF_Start('','');

 

    pdf.FontMode  := wpEmbedTrueTypeFonts;

    pdf.Source    := WPRichText1;

    pdf.Stream := mem;

    pdf.InMemoryMode := true;

    pdf.AutoLaunch:= FALSE;

 

    z := WPRichText1.Zooming;

    WPRichText1.LockScreen;

    try

      WPRichText1.Zooming := 100;

      WPRichText1.ReformatAll;

      pdf.Print;

 

    finally

      WPRichText1.Zooming := z;

      WPRichText1.UnLockScreen(true);

    end;

 

  finally

    pdf.Free;

    WPViewPDF1.LoadFromStream(mem, true);

    mem.Free;

  end;

end;

 

 

If you need to print additional data on each page, such as watermarks, use the OnBeginPrintPage event and draw to the wPDF "Canvas".  Of course you can use BeginDoc to export several documents to the same PDf file and combine the exported data with data exported from reporting engine.

 

Note: Please read "Print On Canvas" for special tasks.