Printing a Bitmap on Printer has no output

Issue #89 resolved
Harry Stahl created an issue

I have a Bitmap that should be printed to the Printer canvas, but the Printer prints only empty pages (the Bitmap has Content, I have testet this).

If PrintDialog1.PrintRange = TPrintRange.prAllPages Then begin For x := 1 To MaxPage do begin FirstPrintPage := (x = 1); PrintPage(Scrollbox1.Bitmap.Canvas, x); // Here the Bitmap is filled with content Printer.Canvas.DrawBitmap (Scrollbox1.Bitmap, RectF (0,0,Scrollbox1.Bitmap.Width, Scrollbox1.Bitmap.Height), RectF (0,0, Printer.PageWidth, Printer.PageHeight), 1, false); if x < MaxPage then Printer.NewPage; end; end

Comments (9)

  1. Harry Stahl reporter

    Additional Info: This works under Windows and mac, but not on Linux:

    if Ziel <> Printer.Canvas then begin Ziel.BeginScene; ziel.Clear (TAlphaColorRec.white); Ziel.EndScene; {$ENDREGION} end; The Bitmap has no White Background.

  2. Eugene Kryukov repo owner

    Actually we have an issue with testing on real printer on Linux, we are working on workaround. We tested by Print To File and Print to VM Host Printer. Bitmap drawing works good for us. Can you check Print To File ? ? In order to understand where is an issue.

  3. Harry Stahl reporter

    When printing to a file it will be directed to the real printer, with an output of empty pages. Drawing text to the Printer.canvas has also no effect.

    Other programs (e.g. gEdit) are working as expected.

    On Windows and mac all is good.

    Try the attachment by yourself...

  4. Harry Stahl reporter

    I'm sorry, but it is not solved. And additionally I get a Segmentation fault, when I call "Execute"-Function of PrintDialog, see attached Screenshot (Version 0.99k).

  5. Log in to comment