Vector Printing Image

Linux specific forum
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Vector Printing Image

Post 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,*.*.*,*.*.*'
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Re: Vector Printing Image

Post 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.
User avatar
Erlend
Enthusiast
Enthusiast
Posts: 125
Joined: Mon Apr 19, 2004 8:22 pm
Location: NORWAY

Re: Vector Printing Image

Post by Erlend »

I am using the same OS/PB combo as you and one my machine the your example is fine no clipping/cropping..
Post Reply