Crop box in pdf

Anyone know how i can get crop box or bleed box from a pdf in Applescript ?
not pagesize, but bleed - or crop box

Actally i guess im after the trim box :-)
this script is starting to look like something i can use.
this gives me the right box in mm
hopefully I can use this in my Filemaker soloution.
the idea is to drop a pdf file in and make the magic happend..
register the printjob, impose it and print it, and put out an invoice.
on run
          set fs to choose file of type "com.adobe.pdf" with prompt "Select one or more PDF files to process:" with multiple selections allowed
          my process_files_(fs)
end run
on open fs
          my process_files_(fs)
end open
on process_files_(fs)
          repeat with f in fs
                    tell application "System Events" to set finfo to the properties of f
                    if kind of finfo is "Folder" then
                              tell application "Finder" to set dirList to (items in f) as alias list
                              do shell script "echo Directory: " & name of finfo & " >> $HOME/Desktop/List.txt"
  process_files_(dirList) -- recurse directories
                    else if tolower(«class extn» of finfo) is not equal to "pdf" then
                              tell me to activate
                              tell me to display dialog (name of finfo & " is not a PDF file") with icon caution giving up after 2
                    else
                              my process_PDF_(f)
                    end if
          end repeat
end process_files_
on process_PDF_(f)
  do shell script "echo " & space & trimbox_(quoted form of POSIX path of f) & return
end process_PDF_
on tolower(theText)
          try
                    set newText to do shell script "echo" & space & theText & space & "|  tr \"[:upper:]\" \"[:lower:]\""
          end try
          return newText
end tolower
on trimbox_(f)
          set tb to do shell script "export VERSIONER_PYTHON_PREFER_32_BIT=yes;
/usr/bin/env python -c  'import os, sys, glob, Quartz
this_pdf = Quartz.CGPDFDocumentCreateWithProvider( Quartz.CGDataProviderCreateWithFilename('\"" & f & "\"') )
page = Quartz.CGPDFDocumentGetPage(this_pdf, 1)
r = Quartz.CGPDFPageGetBoxRect(page, Quartz.kCGPDFTrimBox)
print \"%.4f x %.4f\" % (r.size.width*0.352777778 , r.size.height*0.352777778)
Quartz.CGPDFContextClose(this_pdf)'  "
          return tb
end trimbox_

Similar Messages

  • Preview.app with .pdf: crop box view in slideshow revisted

    Regarding the archived discussion found here:
    https://discussions.apple.com/message/11230425
    The question was never really answered as to provide a working solution for Nicolas. Here is his original question:
    When I preview a .pdf in the "crop box" mode and I start a slideshow, it shows me the "media box" version.
    How can I see the the crop box in the slideshow?
    I have had this same issue with certain PDFs in Preview. The simplest and quickest solution I propose is:
    1) Open PDF in Preview
    2) Find out the actual cropped page size via Tools > Show Inspector
    3) Go to File > Print... and then to Paper Size: Manage Paper Sizes... and create a custom paper size for the cropped page size.
    4) Finally, click on PDF V Save as PDF... and save a copy of the original PDF.
    When you open the file copy in Preview and go to View > Slideshow it will now compose without the crop marks and bleeds.
    If anyone still is having this issue, I hope this helps.

    Since the media box (as you may know) is the size of the largest page in the PDF file, regardless of placement of objects in the PDF. The crop box is always a subsection of this (or the same size, but never larger), defined by you. It should be the part of the PDF page (media box) that contains the text, pictures, etc. that you want the person reading your PDF to see.
    For example, when composing the layout for print publication, you would want to set the media box to be slightly larger than the media you will be printing on. You would then set the crop box to be the precise size of the final, printed media. If you were printing on normal 8.5" x 11" paper then media box would be larger than 8.5" x 11", and the crop box to 8.5 " x 11". This way, you can position pictures and text and whatnot right up to the edge of the printed page. This will also allow you to see whether anything is positioned wrong and is hanging over the edge of the crop box (which would mean it'll be cut off when printed".
    So basically, what I meant to say is: the crop box isn't meant for changing how a PDF is displayed; it's meant to control what prints out, and what doesn't, when printing to paper. Microsoft Excel does the same thing -- when looking at a spreadsheet on the computer, you see all cells. If you want to only print a portion of the spreadsheet then you'd use the "set print area" option. Setting the print area isn't the same as just printing a single page or selection of pages, although in some situations they may produce similar printed pages.

  • Preview.app with .pdf: crop box view in slideshow

    Hi,
    when I preview a .pdf in the "crop box" mode and I start a slideshow, it shows me the "media box" version.
    How can I see the the crop box in the slideshow?

    Since the media box (as you may know) is the size of the largest page in the PDF file, regardless of placement of objects in the PDF. The crop box is always a subsection of this (or the same size, but never larger), defined by you. It should be the part of the PDF page (media box) that contains the text, pictures, etc. that you want the person reading your PDF to see.
    For example, when composing the layout for print publication, you would want to set the media box to be slightly larger than the media you will be printing on. You would then set the crop box to be the precise size of the final, printed media. If you were printing on normal 8.5" x 11" paper then media box would be larger than 8.5" x 11", and the crop box to 8.5 " x 11". This way, you can position pictures and text and whatnot right up to the edge of the printed page. This will also allow you to see whether anything is positioned wrong and is hanging over the edge of the crop box (which would mean it'll be cut off when printed".
    So basically, what I meant to say is: the crop box isn't meant for changing how a PDF is displayed; it's meant to control what prints out, and what doesn't, when printing to paper. Microsoft Excel does the same thing -- when looking at a spreadsheet on the computer, you see all cells. If you want to only print a portion of the spreadsheet then you'd use the "set print area" option. Setting the print area isn't the same as just printing a single page or selection of pages, although in some situations they may produce similar printed pages.

  • Trim marks positioning incorrect for files that have a larger crop box than trim box

    I've seen this question in one other place on the forum, but it doesn't look like it ever got answered. It's been driving me nuts for months, so I'm going to try to do a very simple walkthrough for this problem to find out if this is a glitch in the software, or I'm doing something wrong.
    When telling Acrobat XI Pro to print a PDF with "Trim Marks," the marks are applied to the "CropBox" instead of the "TrimBox." As far as I'm concerned, this is incorrect behavior. Acrobat 9 Pro, on the other hand, applies the Trim Marks to the TrimBox. Since I receive files with bleed and need to print out a sample on the printer on a regular basis, I have found it necessary to leave Acrobat 9 installed just to print these files. I've done a very simple walkthrough on how to generate a very simple mockup file from InDesign and output it to better illustrate the problem.
    I've created a new InDesign document that is 5x7 inches with 1/8" bleed. To make it easier to spot the applicable boxes in the file, I've made a box with a 1/2 point stroke. I made a magenta stroked box that's 5x7 inches to signify the trim, and a cyan stroked box that's 5.25 x 7.25 inches to signify the bleed. I then output it to a high resolution PDF. For the purposes of this example to make sure this can be replicated easily, I'm using the built-in [PDF/X-4:2008] preset to start off with. The only adjustment I'm making to this preset is going to the "Marks and Bleeds" section to check the "Use Document Bleed Settings."
    When opening the resulting PDF in Acrobat XI Pro, you can see that the various "Page Boxes" have been applied properly. "CropBox" is set to 0 to include all of the artwork in the file, "BleedBox" is set to 0 since there's nothing outside of the bleed area in this pdf, and "TrimBox" is set to 0.125 in since we gave this file 1/8" bleed. When going to print the file, you can go to "Advanced" and then "Marks and Bleeds" to enable printing with the "Trim Marks." Once you click ok, you can see in the preview image that the trim marks are lining up to the cyan box instead of the magenta box.
    As an extra step, it's possible to confirm that the trim marks are going to the crop box and not the bleed box or trim box. If you add a slug to your InDesign document and reoutput the pdf (being sure to include the slug area in the "Marks and Bleeds" section), you will find that the Trim Marks are even further outside of the cyan box. If you output your PDF from InDesign with Trim Marks already applied, you can turn on the Trim Marks option when going to print in Acrobat to see that Acrobat's Trim Marks are going outside of the crop box as well instead of overlapping the ones generated by InDesign.
    Is there any fix for this behavior aside from opening the files in Acrobat 9 and printing from there instead?

    yes, in the pure definition of the word in the world of print, Crop DOES equal trim...in the exact concept of what YOU see it as.
    in Adobe's little bubble, they decided to call the outer box the "Crop" so that they could differentiate between trim and crop in the page box model.
    These pictures should help, if not, I'm not going to continue to explain something that you don't want to grasp.
    Each picture shows what Acrobat is calling each page box line.  since they felt the need to call one trim and one crop, you have to widen your concept of what Adobe is defining "crop" as.  Not saying its right, but it is what they are doing, and what is causing the whole issue.
    All that aside, if you are not understanding the page box model, then your PDFs are probably not set up this way, so you probably wouldn't even notice the change... So why are you posting on this thread?

  • Print to Art,Trim or Bleed Box without changing Crop Box

    I understand that Acrobat is aware of the Art, Trim & Bleed boxes set from other applications (Indesign, Illustrator) when exporting to PDF. Is there a way to print only the content within one of these boxes without adjusting the dimensions of the document's Crop Box via Acrobat's "Set Pages Boxes" or "Crop Pages" dialog?
    Thank you and have a great day,
    Brandon Boswell

    This method works, but unfortuantley you cannot save recolor artwork settings(atleast in CS5), to resue this method to save time. Posting this incase this helps.
    Create cmyk global colors of slected artowrk by using swathces palette  >> add selected colors
    Manually create a tint swatch for you destination colors (32130 tints), by using color palette, slide tint over, then add new swatch for each one.
    Edit >> Edit Colors >> Recolor Artwork >>  Click on the smaller swatches on right to set a destination color for each
    see belwo this worked

  • In Photoshop Elements 7, how do I free up the ends of a crop box independently?

    In Photoshop Elements 7, how do I free up the ends of a crop box independently?
    I require the end points to move independently to fit am image crop

    Thanks.
    You have helped tremendously!

  • Preview not saving check boxes in PDF forms

    For some reason 10.6's preview will not save check boxes in PDF forms, you can click them but as soon as you save them they disappear.

    I'm having the exact problem. I have a fillable PDF form that has many checkboxes. Saving the pdf (doesn't matter whether it's 'Save', 'Save All', or 'Save As' under the File menu) will clear/reset the checkboxes in the file.
    Anyone know of a workaround for this? Or, is Apple fixing this soon? I really don't want to get Acrobat Pro 9 (well, I don't think it's compatible with Snow Leopard yet anyway)
    If you'd like a sample PDF file to try it out, let me know.
    Thanks.

  • I want to uncheck the box "Display PDF in Browser" in Reader X preferences but it is greyed out.

    I want to uncheck the box "Display PDF in Browser" in Reader X preferences but it is greyed out in Preferences. No one seems to know how to get it unchecked??
    ANY suggestions please, am wasting my saturday morning. This issue resulted from upgrade to latest Adobe Reader version X but uninstalling and reinstalling the older version is not the answer, tried that :-)

    See if this helps: http://forums.adobe.com/message/4340658
    That is, running Firefox in 32-bit mode with a recent version of FireFox (>= 10).

  • Why won't Acrobat X Pro honor the margin (art box) from PDF's exported from InDesign CS6?

    Why won't Acrobat X Pro honor the margin (art box) from PDF's exported from InDesign CS6?
    When I export a PDF from InDesign CS6 with specific margins, Acrobat does not recognize the Art box. (I have PitStop Pro 11 for page box view)

    Thanks Steve,
    We are exporting PDF's as you indicate. I see the same thing. The boxes are all the size of the original InDesign document. The PDF art box should be predicated by the margins in InDesign. When we had CS3, this worked great. Now, it seems that there is a disconnect between the two Adobe products honoring the page box size. I have contacted the Adobe techs via chat, and they had no clue what I was referring to. I find it mystifying that Acrobat can not interpret the art box set in InDesign as margins.

  • I want to create super-precise crop boxes. Can I create crop boxes from guides?

    I am looking to make extremely precise crop boxes. I would like to position four guides in the shape of a rectangle and then create a crop box of that rectangle. Does Acrobat Pro include this functionality? Is there some other way I could achieve the same result?
    I know that I can fine tune the margins in the Set Page Boxes window until the crop lines are perfectly aligned with the guides but that is very time-consuming and I was looking for a faster solution.

    Thanks for the reply, Bill. I have already tried the snap to grid option. The problem with it is that the grid lines most likely will not be where my guide lines will be. Now if Acrobat Pro had a snap to guides option then that would help, but it doesn't, as far as I'm aware.

  • Is there a way to maximize the crop box?

    Terms: I consider a crop box maximized when it is as large as it can be without exceeding the image size in either dimension.  (For an unconstrained crop, a maximized crop box contains the entire image.)
    When I first select the new crop tool, it is maximized.  If I change the crop box, the only ways I have found to get it maximized again are to cancel the crop and restart -- or zoom in to the pixel level and adjust the crop boundaries.
    Am I missing some magic incantation?
    (This 'maximize crop' feature is one we have -- and use -- in some other image processing software.)

    Howard and Charles -- Thanks.  The reset crop box, whether invoked from the options bar or from the right-click menu, does neither what I wanted, nor what I expected.  (That's not a bad thing; just curious.)
    I set the crop box to 13in by 19in then open a landscape image.  It opens with the crop box in place, giving me a portrait crop out of the middle of the image.  I rotate the image using the mouse and delayed shift key so it's in portrait orientation.  The crop box is giving me the middle of the image (not the whole thing).  Fit on screen lets me see the entire image but obviously doesn't alter the crop area.
    Resetting the crop box returns the image to landscape orientation.  (Not the result I wanted.)  Here's the quite unexpected part: The reset cleared my crop box specifications.  After resetting, the crop box has been set to unconstrained and is now set to the full size of the image.
    I don't consider that a bug -- just a design choice.
    Within my experience, the Crop tool is the only one with this kind of "reset" function.  In the classic crop tool, we had the CLEAR button.  The Reset function is implemented the same way.  The difference is that in previous versions, the CLEAR button isn't available once you have drawn the crop box.  Even in CS6, I haven't found any other tool with a Reset option.  So there is no consistency issue.  How Abobe chooses to implement the reset function for the crop tool will become the standard.
    And the more I think about this, the more I think Adobe should revisit this decision.  I think it would be more useful -- and more reasonable -- for Reset to return the tool settings to whatever the user had specified at the beginning of the crop operation.
    Here's what, to me, is an anomoly in the current implementation: The Reset command doesn't reset ALL of the tool settings.  Reset does not affect "Delete Cropped Pixels" or "Use Classic Mode" or the View setting.

  • How to make crop box uniform size?

    Hi everyone,
    I set the crop height, width and resolution in the top bar. However, when I start to drag the crop boundiing box, it still let me do any size(although in proportion). I know it will crop the image to the size I specifed. But can I have an uniform size crop box every time, so I can cover same amount of area of similar photos.   Thanks, I appreciate it~
    Simon

    Try using the Rectangular Marquee tool.
    You can set the style to Fixed Size in the Options bar and then go to Image > Crop.

  • Unpredictable crop box...is there a preference for this?

    Using my laptop, I tend to rest my thumb on the bottom of the trackpad (where the button is supposed to be) while moving my finger across the trackpad to move the mouse pointer.
    I have trackpad tap-to-click and ALL multitouch gestures turned OFF in System Preferences.
    So why is it that after I carefully position the top-left corner of my crop box, when I slide the pointer across the photo to the lower-right corner to adjust the other corner of the crop box, THE UPPER LEFT-HAND SETTING CHANGES UNPREDICTABLY!
    I finally figured out that it was because iPhoto is interpreting a two-finger gesture. But I have two-finger gestures TURNED OFF. I have them turned off for a reason. How do I get iPhoto to respect this?
    Off to file a bug with Apple...

    Try the following: delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your User/Library/Preferences folder, launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding the the Option key. You'll also have to reset the iPhoto's various preferences.

  • Marquee or Crop Box showing multiple aspect ratios (in CS2?)

    Hi, I use PS CS2 and use a lab that prefers our images be in a 4x6 aspect ratio. At times I crop photos to minimize dead space and want to do so such that the final image can still be printed as a 5x7 or 8x10. I'm wondering if there is some sort of add-on to CS2 that would let me crop at 4x6 but have the crop box show extra lines that represent a 5x7 and/or 8x10 aspect ratio while making my selection. ExpressDigital Darkroom has this type of preview - just wondering if it's available for CS2. Thanks in advance for responses.

    No. Crop is a core tool, not a function. Any such coding would have to be done by Adobe themselves, as I understand these matters. Maybe there is a dedicated cropping filter out there somewhere, but as someone, who doesn't qualify as a Photoshop power user, I'm not aware of it, not even remotely. Sorry.
    Mylenium

  • How do you crop a vertical slide to a constraint size without turning it on it's side? iPhoto 6 automatically rotated the crop box for a vertical slide (picture).

    How do you crop a vertical slide to a constraint size without turning it on it's side? iPhoto 6 automatically rotated the crop box for a vertical slide (picture).

    Select the aspect ratio first.
    Then go back to the same menu and go to the bottom and selectConstrait as portrait.
    OT

Maybe you are looking for

  • STO mail : pdf attachment has an error 'file damage' when try to open it

    Dear expert, I need to send an e-mail to the vendor with the sto list as attachment at the email. I managed to send email to external addresee and made the pdf attachment, BUT somehow when I open the attachment it has an error says "Adobe Reader coul

  • Unable to transform XML with XSL in java code

    Hi, Could somebody please tell me what's wrong with my code, why it isn't transform the XML with XSL to the output that I want. If I use the command line to transform the XML, it output perfectly: java org.apache.xalan.xslt.Process -in marc.xml -xsl

  • Problem with Logon Trigger

    The logon trigger written by me is nt returing either program or module from the V$session table. Here is my trigger create or replace trigger PROGME after logon on database declare v_SCHEMANAME varchar2(30); t_program varchar2(64); begin      v_SCHE

  • Chaning  Condtion types in quotation

    Hi all..,   I am facing problem in changing condition types in quotation using bapi BAPI_CUSTOMERQUOTATION_CHANGE . Istead of changing the existing value,i am getting duplicate records fot it. Can any one help me out of this problem. thanks

  • Can I extract the imaginary component of an image if so how

    I am using imaq vision and I want to introduce random phase into an image therefore want to know if it is possible to extract the phase from the image and then effectively add it back into the image or am I asking the impossible?