Recent

Author Topic: Printing graphics  (Read 972 times)

comander

  • Newbie
  • Posts: 2
Printing graphics
« on: June 15, 2024, 12:02:14 pm »
I have a users image on the screen. When I try to print it, I get this message :
"EXTERNAL ACCESS VIOLATION in address 000000085 in file Printers.PAS line 477"
Line 477 says :  result := (pfRawMode in fFlags);
Problem shows on BeginDoc
I wonder what I am missing or doing wrongly.
I have never used the printers4lazarus paclkage before.
Windows-10/64bit, Lazarus v.3.0RC1, FPC v.3.2.2

bytebites

  • Hero Member
  • *****
  • Posts: 664
Re: Printing graphics
« Reply #1 on: June 15, 2024, 02:21:25 pm »

comander

  • Newbie
  • Posts: 2
Re: Printing graphics
« Reply #2 on: June 16, 2024, 01:01:06 am »
Thanks for the try
It doesnt give any clue to why I get that error. I guess there is something basically I am missing. Same happen when i used  the code from said link

jamie

  • Hero Member
  • *****
  • Posts: 6516
Re: Printing graphics
« Reply #3 on: June 16, 2024, 03:24:43 am »
 Do you have a PDFprinter installed you can test with?

 maybe the image is too large for the printer ?


« Last Edit: June 16, 2024, 03:26:15 am by jamie »
The only true wisdom is knowing you know nothing

jamie

  • Hero Member
  • *****
  • Posts: 6516
Re: Printing graphics
« Reply #4 on: June 16, 2024, 03:45:41 am »
I just ran a test; it works for me.
I added the required package of "printers4Lazarus" in the Project Inspector.


 I selected a printer since it always defaults to the first one which is the MS print to PDF which intervenes at some point asking for a file name.

 My actual hard printer is the last one in the list.

The list of

 PRINTER.Printers which is a Stringlist.

I set the  Printer.PrinterIndex to the printer of my choice.


 Then I sent an image to the printer using the canvas of the printer. "Printer.Canvas...."
etc.

 Maybe you should show some code or a base project you are working with.
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018