Printing issues, Images not printing

  • With this code below, i can open a file into a visual editor (stock placed component no modifications) and send it to a printer and everything prints fine

    Code
    Var  vEditor: TWPRichText;begin  vEditor := TWPRichText.CreateDynamic;  try    vEditor.PrinterSetup;    editor.SaveToStream(FStream);    if FStream.Size > 0 then    begin      FStream.Position := 0;      vEditor.LoadFromStream(FStream);      vEditor.PrintParameter.PrintOptions := vEditor.PrintParameter.PrintOptions + [wpAlwaysHideFieldmarkers];      vEditor.Print();      vEditor.Clear;    end;  finally    FreeAndNil(vEditor);  end;

    AND!


    BUT!

    When the same code is executed via a service on a remote machine, the printing does not print out any headers at all.


    Any ideas on why this would be the case ?

    The only difference on the server side the data is streamed from a TBlobfield into a memory stream then the same process is followed to print a document and the printer to send to is returned dynamically from a database.

    Any particular reason why this would not print out a documents headers ?

    (Yes the physical printer is setup correctly)

  • That doesnt make a difference, it still prints out a document that contains no images in the header.

    this appears to only happen when running a service.

    If we run this as an application, there is no problems.


    ************** EDIT ******************
    ALSO note that when trying to convert to PDF using TWPPDFExport first then opening the PDF in a viewer the images are not printed as well.
    Also without alling ReformatAll(True, False), the method pdfExport.Print will access violate in a service.

    • Offizieller Beitrag

    Hi,

    this could have various reasons, for example that the images cannot be accessed when the app is run as a service.

    Zitat

    The only difference on the server side the data is streamed from a TBlobfield into a memory stream then the same process is followed to print a document and the printer to send to is returned dynamically from a database.

    While debugging this I reccomend to dump a copy of the dara to a file using SaveToFile('c:\temp\databolb.wpt')

    Julian