in

Quark Forums

Round value for page width

Last post 10-27-2009 3:13 PM by Scripting_Ace. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-22-2009 9:28 AM

    Round value for page width

    HI
    Any can resovle this problem
    Actually i need to print page in spreads,
    1. While running the below script the paper width is set decimal value as e.g 409.999 not as 410, Even though i set round function to paper width.
    2. When i assign page width as integer its show value that less that 2mm, e.g if Trim is 200 then output spread shows 398 not as 400.

    tell application "QuarkXPress"
        activate
        if not (exists (document 1)) then
            display dialog "No document open, exit!" buttons {"OK"} default button "OK"
            return
        end if
      
        tell document 1
            set DocName to name as text
            set FilePath to "Users:macuser:Desktop:PDF:In:" & DocName & ".ps"
            set pagewidth to page width as real
            set horizontal measure to millimeters
            set vertical measure to millimeters
        end tell
        tell print setup of document 1
            set registration marks to centered
            set registration marks offset to "6 pt"
            set spreads to true
            set printer type to "AdobePDF 7.0"
            set paper size to "Custom"
            set paper width to round ((pagewidth * 2) + 6)
            set orientation to portrait
            set page position to center horizontal
            set resolution to 2400
            set reduce or enlarge to "100%"
            set print quality to normal
            set data format to binary data
        end tell
        print document 1 PostScript file {FilePath}
    end tell

    Cheers
    Arun Kumar
  • 10-26-2009 9:59 AM In reply to

    Re: Round value for page width

     Maybe I can offer a course of actions...

     I find odd that you cahnge the measuring units as it does not appear to be affecting anything afterwards.

    In fact I would much rather expected to see:

    set horizontal measure to points
    set vertical measure to points

    BEFORE the

    set pagewidth to page width as real

    That would ensure that the value of pagewidth is in fact in points since you will add the offset value to it later.

    Also, your final print size will need to include the registration marks offset TWICE since you will have marks on both the left and right side of your pages.

    Third: You need to also include the length of your regitration marks (TWICE as well) into you final page width.

     Lastly, you should ALWAYS round UP values in these situation. Now I know that round .9 will return 1 but you may come upon a .3 value which you aslo want to return 1. So your line should read:

    set paper width to round ((pagewidth + 6 + RegMark_Length) * 2 ) rounding up

     

    HTH

    Michel Lemieux
    Click here --> to visit my PUBLISHING & SCRIPTING FORUM

  • 10-27-2009 2:44 PM In reply to

    Re: Round value for page width

    HI Scripting_ACE

    Many thanks for your reply.  Problem solved

    But I have on query!

    1. Why rounded function not effect for  measure to millimeters. Is there is any specify reason ?

    2. How to name .ps as LAYOUT Name  rather than file namee

     

    thanks

    Arun 

  • 10-27-2009 3:13 PM In reply to

    Re: Round value for page width

    You missunderstood me.

    You can round any number really. The problem you were having is you were adding 2 values together of different units. 

    so if you want to add Page Width, Registration Mark Offset  and Registration Mark length, they must all be in the same unit.

    200 mm + 6 pt + 12 pt is not equal to 218 mm but rather 206.35 mm

     

    HTH

    Michel Lemieux
    Click here --> to visit my PUBLISHING & SCRIPTING FORUM

Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems