After a little more digging I have a better understanding of my problem. I am creating a wprichtext dynamically and loading a saved rtf from disk into it. I then create a pdf with wppdf. Here is my problem. When I do this in a delphi2006 vcl application it works fine, when I create the pdf via a webservice (also delphi2006, soap), some of the pages end up bleeding onto the next page eventually causing some blank pages, etc...
Both sets of code are identical. My first guess is that it has something to do with the application code residing within a form.
here is the code:
function TWS.GetStoredLetter(SomeStuff: String): TByteDynArray; stdcall;
var
OutputPDFStream: TMemoryStream;
WPPDFExport: TWPPDFExport;
TmpStream: TMemoryStream;
WPRichText: TWPRichText;
begin
...
TmpStream.Seek(0,0);
WPRichText := TWPRichText.CreateDynamic;
WPPDFExport := TWPPDFExport.Create(nil);
WPPDFExport.Source := WPRichText;
WPRichText.LoadFromStream(TmpStream);
WPPDFExport.CompressStreamMethod := wpCompressFastFlate;
WPPDFExport.InMemoryMode := true;
WPPDFExport.Stream := OutputPDFStream;
WPPDFExport.Print;
OutputPDFStream.Seek(0,0);
OutputPDFStream.SaveToFile('testpdf.pdf');
...
end;