Page 1 of 1

How to export to PDF an exact area of a card.

Posted: Wed Dec 15, 2021 2:14 pm
by Fermin
Can anyone help me? I need to create a pdf with the exact capture of a certain area of a card, that is to say, that the pdf shows exclusively that area WITHOUT ANY MARGIN and with THE SAME PROPORTION.

The only thing I get is either that the pdf keeps the proportion but does not fit the image, or that it fits the image but changes the proportion.

I use the values "842,594" to define the paper (I think they correspond to DIN A4).

Thank you very much in advance.

Re: How to export to PDF an exact area of a card.

Posted: Wed Dec 15, 2021 2:54 pm
by Klaus
Hola Fermin,

we can -> print card [from topLeft to bottomRight] [into pageRect]
So maybe this will work for you?

Code: Select all

...
print card 1 from 50,50 to 300,600 into 50,50,300,600
...
Out of my head, but should work! (famous last words... :-) )
Hope I understood you correctly.


Best

Klaus

Re: How to export to PDF an exact area of a card.

Posted: Wed Dec 15, 2021 4:28 pm
by Fermin
Thank you very much, Klaus and sorry for taking so long to reply.
What I get with your example is a landscape DIN A4 size pdf with the 50,50 to 300,600 capture inside and what I would need is for the document itself to be the exact size of that capture, i.e. in your example: 250 x 550 (300-50) x (600-50). . . . .
I'm looking at the Dictionary and I think the issue has to do with other properties like printPaperSize, etc. Let's see...

Translated with www.DeepL.com/Translator (free version)

Re: How to export to PDF an exact area of a card.

Posted: Wed Dec 15, 2021 4:31 pm
by dunbarx
Out of my head,
No surprises there...

Craig

Re: How to export to PDF an exact area of a card.

Posted: Wed Dec 15, 2021 4:36 pm
by Klaus
Fermin wrote:
Wed Dec 15, 2021 4:28 pm
Thank you very much, Klaus and sorry for taking so long to reply.
What I get with your example is a landscape DIN A4 size pdf with the 50,50 to 300,600 capture inside and what I would need is for the document itself to be the exact size of that capture, i.e. in your example: 250 x 550 (300-50) x (600-50). . . . .
I'm looking at the Dictionary and I think the issue has to do with other properties like printPaperSize, etc. Let's see...

Translated with www.DeepL.com/Translator (free version)
Ah, I see, then you should also set the printpapersize etc. accordingly, like this:

Code: Select all

...
set the printpapersize to "250,550"
open pringting to PDF<filename>
set the printMargins to 0,0,0,0
print this cd from 50,50 to 300,600 into 0,0,250,550
close printing to PDF
...

Re: How to export to PDF an exact area of a card.

Posted: Wed Dec 15, 2021 5:38 pm
by Fermin
Siiii!
Yes, it seems to be working, I have to do some definitive tests but I think it's fixed. Thanks once again Klaus. :)

Re: How to export to PDF an exact area of a card.

Posted: Wed Dec 15, 2021 5:48 pm
by Klaus
De nada, Señor! :-)

Just corrected the first line in my example script.