Help with point to millimeters...

Post Reply
lovestjarna
Newbie
Posts: 18
Joined: Mon May 26, 2014 3:50 pm

Help with point to millimeters...

Post by lovestjarna »

I want to have an email being sent every time a PDF has been uploaded. But I want the format to be in mm and not "points". I have created a small email using some Stats and Job variables and saved it as an plain text file. But can I put code/translation within that text file? And how should I write it?

I have found some code on the forum - but can't get it to work properly.



This is how the text file looks like...



- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

A PDF has been uploaded and checked:



Filename: [Job.Name]

Format: [Stats.PageWidth] x [Stats.PageHeight]

Pages: [Stats.NumberOfPages]



Link: [Job.Origin]



/Prepress

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -





So its these I need to change into mm:

Stats.PageWidth

Stats.PageHeight



Also nice to be able to add "mm" after the values...



Thanks



/Kent
freddyp
Advanced member
Posts: 413
Joined: Thu Feb 09, 2012 3:53 pm

Help with point to millimeters...

Post by freddyp »

You can perform calculations with the variables pane. In the Switch group there is a Calculation option and there you can bring up the variables pane again and use +, -, /, *, brackets to specify the calculation in combination with the variables. In your case you will want to use [Stats.PageWidth]/72*25.4 and you will also want to use the Precision to get a nice number.



Check out this video: http://www.youtube.com/watch?v=LBF_wc45cFI. At 5:00 into the video there is an explanation on how to use the Switch-Calculation feature.



Adding mm is just a matter of writing mm after the variable in the mail body.



Freddy
lovestjarna
Newbie
Posts: 18
Joined: Mon May 26, 2014 3:50 pm

Help with point to millimeters...

Post by lovestjarna »

I dont seem to get it to work... The variable "calculation" is of course the perfect way to go. But have tried three different templates and there seems to be error since I still have the variables left in the email sent to me.

Here are my test (that doesnt work...):



- - - - - - - - - - - - - - - -



Filename: [Job.Name]



Format: [Stats.PageWidth]/72*25.4 x [Stats.PageHeight]

Trimbox: [Stats.TrimBoxWidth] x [Stats.TrimBoxHeight]

Page: [Stats.NumberOfPages]





Link: [Job.Origin]



- - - - - - - - - - - - - - - -



Filename: [Job.Name]



Format: [Switch.Calculation:Expression="[Stats.PageWidth]/72*25.4",Precision=”1”] x [Switch.Calculation:Expression="[Stats.PageHeight]/72*25.4",Precision=”1”] mm

Trimbox: [Stats.TrimBoxWidth] x [Stats.TrimBoxHeight]

Page: [Stats.NumberOfPages]





Link: [Job.Origin]



- - - - - - - - - - - - - - - -



Filename: [Job.Name]



Format: [Stats.TrimBoxWidth:Precision=1/72*25.4] x [Stats.TrimBoxHeight:Precision=1/72*25.4] mm

Trimbox: [Stats.TrimBoxWidth] x [Stats.TrimBoxHeight]

Pages: [Stats.NumberOfPages]





Link: [Job.Origin]



- - - - - - - - - - - - - - - -



Any more help would be appreciated!



Thanks
lovestjarna
Newbie
Posts: 18
Joined: Mon May 26, 2014 3:50 pm

Help with point to millimeters...

Post by lovestjarna »

This worked for me...

Could it be that I used the same variable two times?



- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Filename: [Job.Name]



Format: [Switch.Calculation:Expression="[Stats.TrimBoxWidth]/72*25.4",Precision="1"] x [Switch.Calculation:Expression="[Stats.TrimBoxHeight]/72*25.4",Precision="1"] mm

Pages: [Stats.NumberOfPages]





Link: [Job.Origin]



- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -





The only two more thing Im wondering about is if its possible to have no decimal? Using "0" in the precision gives me an empty value. But value "1" gives me "210.0", but only want "210".

Also the Link (Job.Origin) gives me no value back.
freddyp
Advanced member
Posts: 413
Joined: Thu Feb 09, 2012 3:53 pm

Help with point to millimeters...

Post by freddyp »

Indeed, Precision does not work with 0. Is it that bad?



Freddy
freddyp
Advanced member
Posts: 413
Joined: Thu Feb 09, 2012 3:53 pm

Help with point to millimeters...

Post by freddyp »

Forgot to reply to the [Job.Origin]. Not every job has a known origin. When it comes from an FTP site, it does, but when it comes from an input hotfolder it does not. Where does your file come from and what do you expect the value of origin to be?



Freddy
Post Reply