Page 1 of 1

How do I print a JPEG ?

Posted: Sun Jan 29, 2012 5:53 pm
by Happyrever
I have the following print statment
print card 2 from the topLeft of graphic "OuterRect" on card 2 to the bottomRight of graphic "OuterRect" on card 2
and I want to create a .jpg to a file instead.

Context:-
At the moment, a series of cards (with a constant and fixed print area smaller than the actual card) are printed to paper one after another.

I now need to generate a JPEG of this printed area instead and save it to file.

How can the line of code be changed to do this?

The file name and path can be assumed to be set up already and as each card is cycled through, the file name will be incremented by the code.

Re: How do I print a JPEG ?

Posted: Sun Jan 29, 2012 6:20 pm
by jmburnod
Hi Happyrever,
I now need to generate a JPEG of this printed area instead and save it to file.
You can use export snapshot like this :

Code: Select all

put the rect of graphic "OuterRect" into tRect
export snapshot from rect tRect to file MyPathFile as JPEG -- MyPathFile is a valid path
Best regards

Jean-Marc

Re: How do I print a JPEG ?

Posted: Mon Jan 30, 2012 6:20 pm
by Happyrever
Thank you for the answer, it needed a slight modification because although the coordinates were correct, they were taken from the graphic, but used in export as screen coordinates.
the alteration was this
export snapshot from rect tRect on card 1 to file MyPathFile & ".jpg" as JPEG

The ref to the card was key to the solution, because it applied the export back to card coordinates.
The card number only relates to this specific case and is not part of the problem.

Thank you very much jmburnod for the great help.