Page 1 of 1

Vector Printing Image

Posted: Fri Nov 06, 2015 2:15 pm
by coder14
I am trying the new vector printing in 5.40 LTS and it is great. But this example prints well in Windows but on Linux the image gets cropped:

Code: Select all

UseJPEGImageDecoder()
If PrintRequester()
  If StartPrinting("Vector Print")
    If StartVectorDrawing(PrinterVectorOutput())
      ;replace with your own jpg image
      LoadImage(0, "A4_Letter.jpg")
      DrawVectorImage(ImageID(0), 255, VectorOutputWidth(), VectorOutputHeight())
      StopVectorDrawing()
    EndIf
    StopPrinting()
  EndIf
EndIf
I had to use the print requester because DefaultPrinter() gives an invalid memory access and crashes:

Code: Select all

Gtk (CRITICAL): gtk-page_setup_get_paper_size:assertion 'GTK_IS_PAGE_SETUP (setup)' failed
The print requester also gives a warning:

Code: Select all

WARNING: GDBus.Error:org.freedesktop.Avahi.TimeoutError reached
EDIT: there is another error with print requester:

Code: Select all

DEBUG: no profile for device cups-Brother-Laser: nothing matched expression '*.*.600dpi,*.*.*,*.*.*'

Re: Vector Printing Image

Posted: Fri Nov 06, 2015 5:39 pm
by coder14
To see the cropping - Linux Ubuntu Mate 15.10 64bit abd PureBasic 5.40 LTS 64bit:

Code: Select all

UseJPEGImageDecoder()

CreateImage(0, 300, 300)
StartDrawing(ImageOutput(0))
Box(0, 0, 300, 300, RGB(255, 255, 255))
DrawText(0, 0, "A line of text", RGB(0, 0, 0), RGB(255, 255, 255))
StopDrawing()

If PrintRequester()
  If StartPrinting("Vector Print")
    If StartVectorDrawing(PrinterVectorOutput())
      DrawVectorImage(ImageID(0), 255, VectorOutputWidth(), VectorOutputHeight())
      StopVectorDrawing()
    EndIf
    StopPrinting()
  EndIf
EndIf
Image

Printed on the same printer with the same settings.

Re: Vector Printing Image

Posted: Thu Nov 12, 2015 11:54 pm
by Erlend
I am using the same OS/PB combo as you and one my machine the your example is fine no clipping/cropping..