Some issues related to the print form.
Hi,
I am encountering the following issues on Linux (Fedora 40):
- On my pc (screen resolution 2560x1440), some TComboBoxes and TLabels overlap. Even if I change the screen resolution, the overlapping persists.
- I cannot select the printer. If I click on the "Configure..." button, the printer setup dialog that appears does not allow me to change the printer.
This does not happen on Windows; the printer setup dialog is different, probably because it is dependent on the operating system.
I find it strange that no one has complained about this until now.
- If I try to print a blank (transparent) image, an exception is raised. I would like to point out that there has already been a commit regarding the printing of blank images: https://github.com/bgrabitmap/lazpaint/pull/195/commits/db0e11335a5cb12dcc64bde1a1eead1c1a0c14ef
Best regards Melchiorre
Hi Melchiorre,
The problems 1 and 2 are relatively easy to solve, taking into account differences with Linux.
The 3rd one is surprising, given the commit. I'll test it again.
Thank you very much for the detailled feedback with screenshots!
Warm regards
Hi Melchiorre,
I have fixed 1 and 2 on dev branch.
If you have Lazarus, I invite you to test from the dev-lazpaint branch.
Warm regards
I confirm that issues 1 and 2 have been resolved in the dev-lazpaint branch.
Thanks for the patches. Best regards.
Thank you for the confirmation. I can now confidently close this request as completed.
Best regards
In truth, issue 3 still needs to be resolved.
On Linux, the following block of code:
Printer.BeginDoc;
if not Instance.Image.RenderedImage.Empty then
begin
...
end;
Printer.EndDoc;
raises an exception if the image is empty. Removing the check fixes the problem. After all, the image cannot be empty if the transparent areas are filled with white, I think that this check is unnecessary.
Warm regards Melchiorre
Ok, I've removed the check. Indeed, it is not necessary anymore anyway. Am curious though why that would raise an exception.
Thanks again for your feedback!
I’m curious too, but I didn’t understand much.
If the Printer.BegicDoc/EndDoc block is empty, a null parameter is passed to the cairo_show_page procedure, and an exception is raised.
If the Printer.GetCanvas function is called within the Printer.BegicDoc/EndDoc block through the Printer.Canvas property, the parameter passed to the cairo_show_page procedure is correctly assigned, and the exception is not raised.
I don’t think it’s worth spending more time on this issue; I consider it fixed. In any case, I’ve attached a video of the debug.
Best regards, Melchiorre
https://github.com/user-attachments/assets/ddd36954-74f8-4cff-9f22-2e98d9b933ec
Indeed, if it works with the change, no need to delve deeper.
From your debugging video, I suppose that the cr objet is not initialized when the page is not used. This seems to be a bug in the LCL: printing an empty page causes the exception. This could be reported in the LCL bugtracker.
Thank you for your detailed debug. It makes sense now.