Save canvas as PDF

Tried your example project on Xojo 2019 R 3.1 Windows 10 and it worked as expected

You see the whole pic ? I see only a part of it ā€¦ WHY ???

Yes I see the whole pic when I printed it to PDF

Iā€™m not sure but since me and Emile both confirmed it works, are other PDFā€™s displaying alright on your Mac?

Itā€™s very strange iā€™ve no issue seeing pdf (iā€™m on Mac OS X 10.15.6 and Xojo 2019 3.2).

Well I can test on my mac book 10.15.6 Xojo 2019 R3.2 later this evening just to confirm

To give a direct downoad URL, set the ending dl=0 as dl=1, like below:

https://www.dropbox.com/s/0939vos8vazj70v/Test%20Canvas.zip?dl=1

The example is a bit strange:

A image of 700 Ɨ 900 pixels displayed in a 100 x 100 Canvasā€¦

At run time, only a very small part of the above image is displayed, but the generated pdf display it completely in Preview.

On the other hand, you do not give the test conditions (your development environment / loaded and running applications, hard disk free space, etc.)

The use of Crapolina / Xojo 3.2 is also suspect, but Brian will tell us what to think. I do not use them and probably will never do: with so many bad reportsā€¦

At last: when someone told you ā€œthis code worksā€: I think it works. Why would that person lie on a public forum ?

OK I just tried on macOS 10.15.6 and Xoio 2019 R3.2
It does seem to cut off the right side when printing to PDF, I would say 80% of the picture is there

I havenā€™t checked anything else any further as I have to run out and do a few jobs but can check more tomorrow

1 Like

Scale down the % in the print setupā€¦

And this is far from ā€œnot workigā€ā€¦

Thanks Brian.

1 Like

g.DrawPicture Duplicato,50,0,500,800,0,0,Duplicato.Width,Duplicato.height

is OK

Thank you all, your help is invaluable :hugs:

There is something different from your Duplicato file and a French sized PDF:

Duplicato: 700 Ɨ 900
French A4: 596 Ɨ 842

Nota: Duplicato shows some margins, so add these to the intrinsec margins due to the new printings and you may certainly get the explanation (with A4) of the difference.

Brian, youā€™re using US printing size (Letter US or Legal US, I suppose), isnā€™t it ?

At last, there are print options to resize the document to print to the paper sizeā€¦

Emile,
correct Iā€™m using US printing size
Glad everyone chipped in and solved it for the OP :slightly_smiling_face:

1 Like

Can the .pdf be created programatically without going through the dialog in Windows?