Javascript for cropping PDF

Hi
I know it´s probably quite easy to crop PDF document with jacascript but what I need is that ratio of the result would be 1:1.3 (Widht 1 : Height 1.3).
And it should be negative crop (page is not actually cropped at all but enlarged instead of that)
What I try to achieve is a exact page shape that will be exported to 768x1004px JPG or PNG image later (outside of Acrobat).
So the size doesn´t really matter (for once...=) but shape has to be exactly correct.
So for instance letter sized (8,5 in / 11 in) PDF should re-shaped to 8,5 x 11,112 in, that´s the most optimized way to achieve optimized shape....
Is this even possible in Acrobat?

You might want to try a JavaScript forum. This one is for Java, which has nothing to do with JavaScript.

Similar Messages

  • Is there a site where they will write javascript for your pdfs that you could pay them to do it.

    Is there a site where they will write javascript for your pdfs that you could pay them to do it.

    Hi timothyh,
    Adobe doesn't offer those services, but you might try looking here: Planet PDF - The PDF User Community - Debenu.
    Best,
    Sara

  • Display issue with LiveCycle Designer ES4 for cropped PDF in WIN7

    Hi,
    I am having issue displaying the cropped PDF file in the LiveCycle Designer ES4. The PDF files are cropped 3 inches from bottom using Adobe Acrobat 8 Professional. It used to display properly when we have a WinXP machine but once we moved to a Win7 machine, it cannot display the top part of the PDF anymore. Can anyone help on how to fix the display issue? Thanks.
    Kenny
    Environment:
    Adobe LiveCycle Designer ES4 V11.0.0.2013.0303.1.892433
    Adobe Acrobat 8.0.0
    Screenshots
    Win 7, LiveCycle Designer does not display properly
    Win XP, LiveCycle Designer used to display properly

    Thanks vNohria.
    I am having same issue with Adobe Acrobat 9. The Acrobat 9 cropped file is displaying properly under WinXP but have the same issue as above in Win7. This issue seems uncommon as I tried to look for similar issue  and couldn't find any.
    P.S. It's only the Design View in Win7 that has the issue, I can still see the file fine with Preview PDF in both enviornment.
    Design View:
    Preview PDF:

  • Can I open pdf on the web if the link is javascript:viewpipdf(123.pdf)?

    Example: http://www.tntb.gov.tw/core/eng/endownload.php?page=2
    Question: The above website using javascript for download pdf files, how can i config my adobe reader X / Plugin to open it directly?
    Browser : Mozilla Firefox
    Add-on: download statusbar, IE Tab2
    Plugin: Adobe Acrobat 10.0.1.434
    Thanks a lot!!

    I just tried that and its still not working.
    Thanks for the suggestion though :-)

  • PDF Form javascript for making readonly field by using button

    Please let me know the PDF Form JavaScript for making selected fields(Text field,Drop down list,..) as read-only by using Button.

    Do you want your button to be made read only?
    One starts with Acrobat JS Reference.
    // make all fields in a form read only;
    var oField; // variable for field being processed;
    // loop through the form fields;
    for (var i = 0; i < this.numFields; i++) {
    // process each field name;
    oField = this.getField(this.getNthFieldName(i)).readonly = true;

  • Document Level JavaScript to turn off caching for a PDF?

    I have been trying to find a way to ensure that a fillable PDF leaves no trace of itself on a computer that was used to open it. For example, if a user acceses a fillable PDF via browser or Reader, once they are done and have closed the browser or Reader, I want no trace of the information to remain in any cache on that machine. We don't want to require our users to try to control cache via settings in Reader, so I have been trying to find other ways to do this.
    I came across the following comment from GKaiseril in another thread - is this a way for a PDF to control its own caching? Any details or alternative approaches would be welcome!
    GKaiseril
    Re: Metadata - Can't remove
     You can also use document level JavaScirpts to turn off the auto complete and caching for a given PDF.

    Version 9 and 10 of Reader do not cache form data in a temporary FDF as previous version may have. The nocache document property it not even documented in the latest Acrobat JavaScript reference. If you're concerned about previous versions, you can use set the nocache document property at run-time, but users can disable JavaScript, so that approach is no guarantee.
    For information on controlling autocomplete, see: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.407.html

  • PDF Form Javascript for getting User LoginName

    Please let me know PDF Form JavaScript for showing User Login Name (login id) in the Text Field (text1), when using Button (button1).

    As noted there has to be a special folder level script installed on each user's system. This script can be written to access individual properties of the identity object or only a specific property. One can also create a function to access the identity object or even create new properties.

  • Script inquiry (help please :) - Crop PDF and save as JPG

    I'm sure this will be an easy one for some of you. I want to have a script that takes a PDF of a cover file (usually very wide since it's printed along the front, spine, and back of the book), crops out the crop marks (I have a little code snippet that I found that can do this), prompts for the width of the front cover size (i.e. 6 inches for a 6" x 9" book), and then sets the crop box from the far right edge to the width that was input. I'm trying to put together a little tool for my company's Art Department to save them time creating jpegs of our books covers (there are a lot of them). Their current process is to place the PDF in Indesign on a 6x9 page and export a JPG from there, seems time consuming.
    As an example, a cover file for one of our books, without the trim marks, is 12.625" by 9". The script would prompt a user for the width of the cover, they would input 6" and it would, ideally, set the crop box to be 6" wide and 9" high (not touching the height, since that is already correct), and then save that cropped PDF as a JPG (and not save the cropped PDF so as to leave it untouched after the process is done), preferably with an option to select the output location and even batch run it on a bunch of PDF cover files.
    I'm sure this is possible, does anyone think it will be particularly easy? I don't have a lot of experience but I'm not necessarily looking for a handout since I'm not really bringing a whole lot to the table (but will take one!). Any help or pointers appreciated, or maybe someone who already has something like this could provide some help or resources to get started, even If I have to piece it together from a series of helpful URLs.
    Thanks in advance for any helpful responses I'm anticipating!
    Nick

    Take a look at these two Acrobat JavaScript methods:
    Doc.setPageBoxes():
    http://help.adobe.com/livedocs/acrobat_sdk/11/Acrobat11_HTMLHelp/wwhelp/wwhimpl/common/htm l/wwhelp.htm?context=Acrobat11…
    This function allows you to set the crop box. When you combine this with Doc.getPageBox(), you can then adjust the crop box to e.g. the 6" area you want.
    Doc.saveAs():
    http://help.adobe.com/livedocs/acrobat_sdk/11/Acrobat11_HTMLHelp/wwhelp/wwhimpl/common/htm l/wwhelp.htm?context=Acrobat11_HTMLHelp&file=JS_API_AcroJS.89.530.html
    As you can see, the cConvID parameter allows you to specify the output format - and JPEG is an option.

  • Javascript for setting the CropBox Units in Millimetres

    Hi
    I am looking for a Javascript for setting the CropBox Units in Millimetres.
    I have a pdf mag that needs the CropBox settings of all the units to be 7.408 mm.
    Any help pretty please?
    Thanks

    Hi,
    here is a sample script that put boxes size in Millimetres into custom properties metadatas fields.
    It can run from an Action, from the console, or from any form field (button…).
    Feel free to re-use/customize it.
    var mbox = this.getPageBox("Media");
    var Mzeroz = Math.round(mbox[0] * 0.3527);
    var Munz = Math.round(mbox[1] * 0.3527);
    var Mdeuz = Math.round(mbox[2] * 0.3527);
    var Mtroiz = Math.round(mbox[3] * 0.3527);
    var cbox = this.getPageBox("Crop");
    var Czeroz = Math.round(cbox[0] * 0.3527);
    var Cunz = Math.round(cbox[1] * 0.3527);
    var Cdeuz = Math.round(cbox[2] * 0.3527);
    var Ctroiz = Math.round(cbox[3] * 0.3527);
    var tbox = this.getPageBox("Trim");
    var Tzeroz = Math.round(tbox[0] * 0.3527);
    var Tunz = Math.round(tbox[1] * 0.3527);
    var Tdeuz = Math.round(tbox[2] * 0.3527);
    var Ttroiz = Math.round(tbox[3] * 0.3527);
    var bbox = this.getPageBox("Bleed");
    var Bzeroz = Math.round(bbox[0] * 0.3527);
    var Bunz = Math.round(bbox[1] * 0.3527);
    var Bdeuz = Math.round(bbox[2] * 0.3527);
    var Btroiz = Math.round(bbox[3] * 0.3527);
    var abox = this.getPageBox("Art");
    var Azeroz = Math.round(abox[0] * 0.3527);
    var Aunz = Math.round(abox[1] * 0.3527);
    var Adeuz = Math.round(abox[2] * 0.3527);
    var Atroiz = Math.round(abox[3] * 0.3527);
    if (app.language == "FRA")
    this.info.Zone_de_media_en_mm = Mzeroz + ", " + Mdeuz + ", " + Munz + ", " + Mtroiz;
    this.info.Zone_de_recadrage_en_mm = Czeroz + ", " + Cdeuz + ", " + Cunz + ", " + Ctroiz;
    this.info.Zone_de_rognage_en_mm = Tzeroz + ", " + Tdeuz + ", " + Tunz + ", " + Ttroiz;
    this.info.Zone_de_fond_perdu_en_mm = Bzeroz + ", " + Bdeuz + ", " + Bunz + ", " + Btroiz;
    this.info.Zone_graphique_en_mm = Azeroz + ", " + Adeuz + ", " + Aunz + ", " + Atroiz;
    else
    this.info.MediaBox_in_mm = Mzeroz + ", " + Mdeuz + ", " + Munz + ", " + Mtroiz;
    this.info.CropBox_in_mm = Czeroz + ", " + Cdeuz + ", " + Cunz + ", " + Ctroiz;
    this.info.TrimBox_in_mm = Tzeroz + ", " + Tdeuz + ", " + Tunz + ", " + Ttroiz;
    this.info.BleedBox_in_mm = Bzeroz + ", " + Bdeuz + ", " + Bunz + ", " + Btroiz;
    this.info.ArtBox_in_mm = Azeroz + ", " + Adeuz + ", " + Aunz + ", " + Atroiz;

  • Javascript won't work - JavaScript for Reader Mobile API Reference (Android)

    I have created a Form with the new Adobe Acrobat Pro DC (trial version).
    The Javascript code just won't work on a mobile phone.
    Doc - JavaScript for Reader Mobile API Reference (Android this shows that what I want to do is supported.
    But not even the simplest command will work on my phone. (I am using Adobe Acrobat DC - PDF reader for Android)
    Any suggestions of what I could be doing wrong?
    Best,
    Menno

    A Doc.getField() should work.. Try small steps: Create a document with two fields (e.g. Text1 and Text2), then create a custom calculation script for Text2 that uses the following code:
    event.value = this.getField("Text1").value;
    Does this copy the data you enter in Text1 to Text2?
    Then, add a third field ("Text3") and a button with the following MouseUp JavaScript action:
    this.getField("Text3").value = this.getField("Text1").value;
    Does this work? It actually works for me. To save you some work, here is a link to the test file I've used: http://khkonsulting.com/files/AUC/AndroidTest.pdf

  • How to disable 'Enable JavaScript' and 'Display PDF in browser' in Adobe Reader 9.1 msi?

    I'd like to how to disable 'Enable JavaScript' and 'Display PDF in browser' in Adobe Reader 9.1 msi.
    Any help would be appreciated.

    NeoChang:
    You can modify the installation package using the Adobe Customization Wizard to toggle the "Display PDF in Browser" but I have not found a setting to disable JavaScript from the Wizard. I have created a script which makes the changes, but it has to be run for every user since that info is stored in the User hive of the Windows registry.
    Disable JavaScript:
    REG ADD "HKCU\SOFTWARE\Adobe\Acrobat Reader\9.0\JSPrefs" /v bEnableJS /d 0 /t REG_DWORD /f
    Disable Browser Integration:
    REG ADD "HKCU\Software\Adobe\Acrobat Reader\9.0\Originals" /v bBrowserIntegration /d 0 /t REG_DWORD /f
    Michael
    ~Simplicity of Character is a Natural Result of Profound Thought~

  • Pdf javascript in mobile pdf reader

    Hello all,
    I have embadded some javascript in my pdf and the javascript works in PC adobe reader. I find that the javascript does not work android adobe reader, can i ask how can I preview the pdf open in android adobe reader or I can write some javscript for android adobe reader?
    for example, in PC, the javascript is this.closeDoc();
    what is the javascript in android adobe reader?
    Many Thanks
    Sunny

    With Adobe Mobile Reader some JavaScript is supported but not all.
    So testing if very important to determine if your script will work or not.
    Also you need to be aware that not all apps on mobile devices support JavaScript so again testing by individual app is needed to determine if your script will work or not.

  • Cropped .pdf in Preview To Show Permanent Cropping?

    Hello
    I am trying to get a multiple page .pdf that I created and cropped in Preview onto my iPad.
    I understand the process, however when I finally view the file on the iPad, it has the original scans from the .pdf and not the ones I carefully cropped to make neater.
    How can I save a .pdf to permanently reflect the cropping I made?
    Many Thanks

    In the Preview Help (page about Crop) you will may read :
    +Rognage de documents PDF+
    +Il est possible de rogner une page d'un document PDF afin de supprimer des portions inutiles. Vous pouvez rogner uniquement la page affichée ou toutes les pages du document.+
    +*Le rognage de document n'affecte pas son contenu. _Vous pouvez visualiser à nouveau le document original_ en choisissant Présentation > Afficher PDF > Zone de données*+.
    which an automatic translator translate as :
    +Crop PDF document+
    +It is possible to crop a page of a document PDF to remove useless portions. You can crop only the displayed page or all the pages of the document.+
    +*Cropping document does not affect its contents. _You can display again the original document_ by choosing View > Show PDF > Zone of data.*+
    Given that, it's clear that the cropped PDF just embed the infos decribing the size and the location of the cropping shape.
    It appears that the app displaying these PDFs on the ipad is unaware of this feature.
    It would be a good idea to post a feedback to Apple.
    I don't know if they have a link dedicated to the ipad or if the one used for mac applications is valid.
    Given the current behaviour, it would be useful to use a tool able to apply a 'destructive' crop.
    You may start testing *_TransformPDFtoImages Service - 1.0_* (free)
    http://sourceforge.net/projects/transformpdftoi/
    You may also try, Proview (not free)
    http://www.coherentpdf.com/proview-features.html
    Yvan KOENIG (VALLAURIS, France) vendredi 14 mai 2010 17:14:05

  • JavaScript in the PDF can hide toolbar buttons

    Hi Leonard,
    You mentioned in http://forums.adobe.com/message/2161074#2161074 that "JavaScript in the PDF can hide toolbar buttons."
    According to the Javascript docs for Acrobat 7 the App.HideToolbarButton function only runs at AppInit.  Which means that I would have to have the javascript in a file.  How can I do that from within the document?  Is there another way to to do set this from our web application?
    Rob

    Perhaps that's simply a feature that isn't supported by presenting a Captivate intended for the web from inside a PDF?
    Just guessing... Rick

  • Setting margins for "Create PDF from Clipboard"

    I'm posting this because I could not find another question that dealt with my problem directly, but after A LOT of searching, and a few failed attempts, I did find the solution.
    Problem: When creating a PDF from content copied to the clipboard from a webpage, everything on the page was way off-center, with almost no left margin.
    Once the PDF was created, since there is no easy way to adjust page margins, the only way to center everything would have been one page at a time (for 24 pages), by dragging the page contents manually to the center of the page. I tried using the "Set Page Boxes" function, but I ended up with 24 blank pages. Yes, I could export the PDF as a Word document, and then reprint that Word document as a PDF, but I knew there had to be a simpler way.
    Solution: When you create a PDF from a clipboard containing text (or in the case of the above document, text and images), Acrobat uses the settings for "Create PDF from Web Page."
    Unfortunately, if you look up Convert clipboard content to PDF in Acrobat Help, it doesn't tell you that. AND the settings for "Create PDF from Web Page" are NOT included in the list of settings under Preferences > Convert to PDF. There is an HTML option in that list, but there are no editable settings for that file type (There are actually quite a few such file types listed there, and my question is, if there are no editable settings, why are they even listed under Preferences?). Batch Conversion of Text Files also uses the same settings.
    So, here's how to do it:
    Select File > Create > PDF from Web Page
    Click on Settings
    To adjust the default margins for new PDF files created from a clipboard containing text, select the Page Layout tab, and adjust the margins to your liking. Notice how small the Default right and left margins are... hence my problem.
    Click on OK to save your new settings, and the simply Cancel out of the "Create PDF from Web Page" dialog box. If you read this page, it says you have to actually create at least one PDF file using the "Create PDF from Web Page" dialog in order for your settings to stick, but I never did, and my settings were saved just fine.
    If you're copying basic text (or converting text files), that's all there is to it.
    With web page content, there could still be a problem (as there was with this web page), if the content you've selected is not the full width of the web page. I think this has to do with the fact that web pages often use Content Style Sheets to format their page elements, and those styles are transferred when you copy that content to the clipboard. The PDF page margins are technically correct now, as you can see by the position of the image at the top of the page, but the text portion (at the bottom of the page) of the PDF only fills the same percentage of the text area (between the margins) as it did on the web page.
    The only solution I have found if this happens, is to export the PDF as a Word document, and adjust the margins there. In the document I was working with in these examples, there were boatloads of different invisible subsections to the document, and each subsection had different settings for right and left indent, fonts, font sizes, etc., so there was a lot more to it than a simple 'copy & paste' type of procedure. Once I corrected all the different elements (and this one had a whole lot of weirdness going on), and then printed it as a new PDF, everything looked much better.
    Hopefully this helps someone else find their answer much easier than I found mine
    And of course, comments and suggestions are welcome.

    Thanks for asking. Yes, with either the Crop tool or the Set Page Boxes tool, I could trim the page just fine, removing the excess from the right side, but as soon as I tried to add space to the left side, it just blanked out the whole page. It seemed like it should have worked, and maybe on a simple text file it would have. But that particular array of content proved to be most troublesome.
    I also could have just cropped the page down to 6.5 x 11, and then centered it when I printed it.
    My primary goal in searching for the answer, and my main reason for posting this, was for setting the margins for future documents (and to help others find those settings,too). Since I still had the web address, I could easily recreate the PDF once I figured out how to set the margins. Of course I didn't realize that there would still be problems once I got the settings right. Like I said, that particular web page seemed to have several unique difficulties.

Maybe you are looking for

  • How to configure RDS to let a specific RDS group access a specific RDS server (no VDI or farm) ?

    Hi there, We have one domain with 40 sites. On each site is a RODC, wich also has RDS. (RDS the old way, no broker installed) The RODC's are 2008R2 and 2012R2 servers. Everything works fine, however everyone can access all servers as a straight forwa

  • Doubt when launching an AdobeForm object in a Webdynpro Abap.

    Hi Experts! I built a simply Webdynpro with an "ADOBE FORM" object. The Form, is also quite simple (at the moment). But I am having a trouble when the Form is launched. I only can see its Fields as a "READ ONLY". It is not possible to modify anything

  • Extract the photo in ArchiveLink and save the file in a path of the server

    Hi all, I need extract the photo file in SAP HCM, object HRIEMPFOTO, and save as a file in a path of the application server, can someone help me how can I do?? thanks!!! Best Regards, Félix

  • Embed font

    I believe app developers can embed fonts- as I have apps that work with fonts (not just pictures of fonts) that are not available on the default system of the iPad. I hope this capability will be offered to iBooks' authors, or alternatively, an abili

  • Javascript Error with UIX Page

    Hi all, I am using JHeadstart 10.1.2.2.32 with JDeveloper 10.1.2.1.0 to develop UIX pages. I have run into the following problem with one of my UIX pages. We have a page with a table view which uses sortable headers. In certain situations when using