Source code organization: How to divide large JavaScript files into several smaller JavaScript files?

Hello,
some of my JavaScripts have become considerably large over time. What I would like to do is to split a single (large) JavaScript source file into several smaller source files plus an additional JavaScript file containing code or directives to recombine the split files.
In other words, I would like to organize my JavaScript source code into re-usable modules.
Although I searched the Acrobat JavaScript developer documentation and did a lot of Web searching, I still have no idea...
whether the Acrobat JavaScript scripting environment itself does provide a code structuring mechanism
how to properly organize large Acrobat JavaScripts in general.
Any help would be greatly appreciated! Thanks a lot in advance!
Sebastian

Document-level scripts are not accessible to other documents/scripts, so they're not a good option.
Folder-level scripts, on the other hand, are accessible to all other documents/scripts. So if you have a general function that creates a 3D annotation, for example, you can place it in a folder-level script and then call it from other scripts (you will probably need to provide it a handle for the document and properties of the annotation).
One thing to be aware of, though, is that the folder-level scripts are loaded alphabetically, so don't put a reference in script aaa.js to something that loads in zzz.js, or you will get an error message when you open Acrobat. (this is not a problem if zzz.js is not called during the launch of Acrobat)

Similar Messages

  • Compressing large file into several small files

    what can i use to compress a 5gb file in several smaller files, and that will easy rejoined at a later date?
    thanks

    Hi, Simon.
    Actually, what it sounds like you want to do is take a large file and break it up into several compressed files that can later be rejoined.
    Two ideas for you:
    1. Put a copy of the file in a folder of its own, then create a disk image of that folder. You can then create a segmented disk image using the segment verb of the hditutil command in Terminal. Disk Utility provides a graphical user interface (GUI) to some of the functions in hdiutil, but unfortunately not the segment verb, so you have to use hditutil in Terminal to segment a disk image.
    2. If you have StuffIt Deluxe, you can create a segmented archive. This takes one large StuffIt archive and breaks it into smaller segments of a size you define.2.1. You first make a StuffIt archive of the large file, then use StuffIt's Segment function to break this into segments.
    2.2. Copying all the segments back to your hard drive and Unstuffing the first segment (which is readily identifiable) will unpack all the segments and recreate the original, large file.I'm not sure if StufIt Standard Edition supports creating segmented archives, but I know StuffIt Deluxe does as I have that product.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • How to split a big file into several small files using XI

    Hi,
    Is there any way to split a huge file into small files using XI.
    Thanks
    Mukesh

    There is a how to guide for using file adapters, an "sdn search" will get you the document.
    Based on that , read a file into XI, Use strings to store the file content and do the split
    here is some code to get you started
    ===========
    Pseudocode:
    ===========
    // This can be passed in - however many output files to which the source is split
    numOutputFiles = 5;
    // Create the same number of filehandles as numOutputFiles specifies
    open file1, file2, file3, file4, file5;
    // Create an Array to hold the references to those filehandles
    Array[5] fileHandles = {file1, file2, file3, file5, file5};
    // Initialize a loop counter
    int loopCounter = 0;
    // a temporary holder to "point" the output stream to the correct output file
    File currentOutputFile = null;
    // loop through your input file
    while (sourceFile.nextLine != null)
    loopCounter++;
    if (loopCounter == (numOutputFiles +1) // you've reached 5, loop back
    loopCounter = 1;
    currentOutputFile = fileHandles[loopCounter]; // gets the output file at that index of the array
    currentOutputFile.write(sourceFile.nextLine);
    regards
    krishna

  • How to Zip a Large File into Several Mini Zip Files?

    Hi Everyone,
    I've got a few camera video clips (about 100MB in size each) that I would like to send through e-mail.
    I've got to split them into smaller pieces, but how do I get this done?
    I don't want to use third party applications (if possible)
    I've Googled and found a few suggestions but I can't seem to get anything done.
    I tried the Terminal approach, but the command "zip" does not exist.
    man zip does not exist...
    If I do a Create Archive - it will result in a single zip file, but I need to split it to a few segments, plus I'm trying to send these to Windows users.
    Please help, and thanks in advance...

    Hi Sagasse buddy, thanks for your reply.
    Found something interesting as I was browsing VersionTracker.
    Zip Tools 1.1 at http://versiontracker.com/dyn/moreinfo/macosx/15462
    +Product Description:+
    +Installs zip 2.32 and unzip 5.52 files.+
    +I noticed some time ago that there are a lot of machines out there without a copy of the zip and unzip binaries that Apple installs as part of their Developer Tools. As these tools are very useful, and several people, including myself, have written applications or scripts that depend at least in part on this binaries, I've built an installer.+
    +Note, I didn't make the binaries, I'm just redistributing them because they can be hard to find and install if you're not "in the know".+
    +These binaries are meant to be used from the Terminal and include no GUI, let alone an Aqua one. For your convenience, I have included a drag-and-drop AppleScript that will allow you to use the tools without going to the Terminal.+
    Maybe I do not have those binaries in my machine...
    I'll try out your suggestion as well as this Zip Tools 1.1 thingy.
    Message was edited by: Jeffry®

  • Publishing large files into several small ones?

    Hello everyone.
    I have a project, almost 16 mb large. It;s quite large and the users have to wait a bit to get the tutorial.
    I tried this. I split the porject into different projects like 1. menu, 2. description, 3. practice. and then I link the projeect menu to description, practice and so on. So it's working fine! I think this is a good solution to stop the students boredom. Now there is a little problem on this.... THE TABLE OF CONTENTS. For every project there is a new table of contents.
    So, How can I do to have the same table of contents in all the projects? or better yet, How can I do to publish the whole project but like streaming, I mean instead of loading the 16mb I want it loads deppending on the slide the student is. Is it possible????
    Thanks a million!
    Ben

    Hi there
    There are many variables at stake here, such as Captivate version as well as how you are presenting the TOC.
    If you are using Captivate 3, perhaps explore the MenuBuilder application.
    If you are using Captivate 4 or 5, You might investigate using the Aggregator application.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcererStone Blog
    Captivate eBooks

  • How can I divide one big long track into several smaller ones?

    I have many mp3"s I imported or downloaded in my Library of lectures, sermons and speeches.
    How can I divide one big long track into several smaller ones?
    Any input would be great.

    lakergrl wrote:
    How do I split one very long track into several tracks (audio journal split into each day)
    http://www.bulletsandbones.com/GB/GBFAQ.html#exportsections
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • How to break up a large .java file into several?

    Hi,
    I have a pretty large .java file containing many private methods. I rather not have to always work in this very large file. Is there a way to separate this into several smaller files, but to maintain the same relationship of all these private methods being part of the same class?
    Thanks in advance,
    Steve

    I thought that would be the answer. This is my first
    Java app. It uses Swing and I use NetBeans as my
    IDE.
    I knew it was getting too large, but I was trying to
    avoid having to reimplement the whole thing. I have a
    few more features to add and I can see this file
    growing by another 300-400 lines.You'll find it a lot simpler to write the second time round. You really don't want to have classes that big
    I do in fact have a couple other .java files where I
    created separate classes. Its just that I really need
    to rethink or redesign this whole thing.You do. Sounds like you've got one class that does too many things. What does this big class do? Adding new features shouldn't bloat your code this way

  • How to transfer input file into XI through sender file adapter

    Hi
    I am quite new to XI. Want to know how I can transfer a file into XI through sender file adapter. I dont have any input file, so I have to create a sample input file and I want to transfer that into XI. Can you please advise me of the steps involved in that. I have finished work in design and directory, now I want to push file the sample file into XI. The receiver adapter is an IDoc adapter. And also a very trivial question. How I can place my sample file into my source directory. Thanks

    Hi Rajiv,
    If your transport protocol is NFS then you need to put the file in the XI server. Because it becomes the Network File System. For that you can just type the ip address of the XI server in the "run" command or in the browser with "
    " then in any of the Folders you can paste your file. But ensure that this is the path you give in your Sender File Adapter.
    If your transport protocol is FTP then you need to see that ftp is running in your system. for that go to Control Panel>Add/Remove Programs>Add/Remove Components. In that check the IIS server and go to details and see that ftp is also checked. Now ftp is running in your system.
    Now open your C:> drive >InetPub>ftproot . and create a folder here and paste your file. In the configuration of your File sender adapter just mention the name of the folder.
    For your information, you can create a file with xml tags and namespace and message type manually (or) you can directly get it from the test tab of message mapping and generate source code.

  • How to export the same mb size of my cr2 files into jpg or tiff files in Lr?

    How to export the same mb size of my cr2 files into jpg or tiff files in Lr?
    Let's say my file size is 22mb, when i export the file to tiff or jpg, although Iam careful with the settings- file size, dimension, resolution, I can't manioukate how I want it.
    With jpg I tried everything, no matter what i do or change in files size or resoltion it remains the same size- 7mb as opposed to 22..
    Please advise,
    Best wishes,
    T

    I would noramlly opt for a tiff file, sending such a high res through the nest a nightmare
    This is probably just an improper use of terminology, but the resolution of a JPG, DNG and TIF should all be the same.
    The files differ in size, not resolution and not number of pixels.
    Jpg is not that bad, but its a pitty they have to be edited under a jpg format..
    Your raws are edited as raw. There is no loss of quality in the editing process. The files are then exported as JPG, which will cause a loss of quality. For just about any use, the loss of quality in the image when you export a JPG at quality level 12 is NOT noticeable. For many uses, exporting a JPG at a quality level of 8 will not be noticeable either, unless you intend to print the photo at a very large size. As twenty_one (not his real name) said, "Jpeg compression is fantastically effective".

  • How do i combine multiple pdf file into a single pdf file?

    how do i combine multiple pdf files into a single pdf file?

    The thread was started in early March and it's Mid-April, I know this very well. The OP of this thread posted a very common and simple question or maybe he/she would have resolved this. For an Adobe Acrobat user it's not at all difficult to combine multiple PDF files into one. But to combine PDF files full version of Adobe Acrobat is mainly required, otherwise PDF files can't be combined. For example, I'm using Adobe Acrobat 9 Pro. These simple steps are mainly required to combine PDF files:
    Open Adobe Acrobat.
    Click on Combine and click on Merge files into a single PDF.
    A window will be appearing, click on Add Files and select the PDF files you want to combine.
    Arrange the selected files in any order with the help of Move Up and Move Down button.
    Now click on Combine File and the selected PDF files will be combined within a few seconds.
    A new PDF file will be created. Click on Save As and name this new PDF file. Then, click on Save.
    A new PDF file will be created and all the selected PDF files are combined in it. The steps shown above might be different in other versions of Adobe Acrobat. Other than this, some third-party PDF merge software are also available. Most of them are available with a demo version for free evaluation. I've heard much about SysInfoTools PDF Merge software on other forums and directories and it's demo version is freely available. One may check its demo version if Adobe Acrobat (full version) is not available.
    Regards

  • I want to insert .pdf files into a "Master" .pdf file at pre-determined intervals - how do I do this?

    I want to insert .pdf files into a "Master" .pdf file at pre-determined intervals - how do I do this?

    Hi markm11762689,
    When you insert pages, you can determine whether they go before or after the first or last page, or a page number that you specify.
    If you're inserting multiple files at once, they will all be inserted in the same spot that you specify in the Select File to Insert dialog box.
    There may be a way to handle this programmatically, and there are some very clever folks who visit these forums regularly. Let's see if they chime in...
    Best,
    Sara

  • How to split a file into two small file

    Hi All,
              I want to raed a file from FTP server.Then i have to split a file into two small file.File format look like this.
             R01!service_order!item_guid!resource_guid!assignment_guid
             R02!Service_order!product_id!product_discription!quantity
             R02!Service_order!product_id!product_discription!quantity
             R02!Service_order!product_id!product_discription!quantity
    i want split file into 2 file,according to header and item details.one table containt header information (label R01) and second table containt (label R02).
    can anybody help me for this.how can i split into 2 file.
    Thanks
    Vishwas Sahu

    Create 2 internal tables. sat it_header, it_detail
    Check for 1st 3 characters and if it is R01 then send it into it_header and if it comes out to be R02 then send it to it_detail.
    Once done... You can either attach these tables into mail as two seperate files
    Or you can download each internal table using GUI_DOWNLOAD.
    Hope this helps!!
    Kanchan

  • Could any one tell me how to divide a BMP image into pixel blocks

    I am new in Java, Could anyone please show me how to block an BMP image into segmented blocks. Please help.

    could you be a bit more specific? What segmented blocks are you talking about? Is the width and the height of these segmented blocks givenby the user or does it have to be equal blocks of the whole image?

  • How to compress a bunch of .java files into a single .jar file?

    Hello everyone! I am working on a Chinese segmentation job. Someone offers very excellent
    such tool. When I copy his example, I find it imports
              import org.apache.lucene.analysis.Analyzer;
              import org.apache.lucene.analysis.Token;
              import org.apache.lucene.analysis.TokenStream;
              import org.mira.lucene.analysis.IK_CAnalyzer;I have downloaded IK_CAnalyzer.jar file which contains org.mira.lucene.analysis.IK_CAnalyzer class.
    I find that I need to download lucene, thus I went into the following website
    http://lucene.apache.org/#06+May+2008+-+Lucene+Java+2.3.2+availableand downloaded the lucene-2.3.2-src.tar.gz. Aftre unzip, I found all java source files in java directory (and in many other different subdirectories). Now it seems I need to compile all the src files and compress them into a single .jar file while keeping their original hierarchy unchanged
    I think I should use jar command and with some additional options.
    Can anyone show me how to do that?
    Many thanks!
    Edited by: aaron9979215 on Jul 12, 2008 5:17 AM

    Thanks for reply, I?ve read that tutorial before I post. Howevver, it do tells how to compress a jar file.
    The question I have is how to compile two .java file stored in different packages like
    rootPackage-->subPackage-->a.java
    rootPackage-->subPackage2-->b.java
    I want to compile a,java and b.java both and keep their hierarchy like rootPackage.subPackage.a unchanged. If I directly go into subPackage and compile a.java, I think the hierarchy is changed.
    What do you think about it?

  • How can I break a PDF into several PDFs of just a few pages?

    I have a large pdf of about 30 pages broken into several pdf's of just a few pages each.  How can I accomplish this?

    Hi drn1234,
    Bernd is right--you need Acrobat. If you don't have it, you can try it for free for 30 days. See www.adobe.com/products/acrobat.html for more information.
    Best,
    Sara

Maybe you are looking for

  • I JUST SYNCED MY NEW IPOD TOUCH TO MY ITUNES LIBRARY BUT iT WONT LET ME EDIT THE MUSIC ON THE IPOD.  i WANT TO MANUALLY ADD AND DELETE CERTAIN PLAYLIST OR SONGS/

    I have a new ipod touch replacing an old damadged one.  I have it synced to my computer but I cant edit the songs in my playlist on my ipod or delete any playlist.  I also can not create new playlist for the ipod  Can anyone help me?

  • I Tunes not recognizing the I Pod, I Pod is frozen.

    Hi thank you for Holping me with the Error 1417 and 1418, Before i can try thos solutions I have A new problum. I Tunes is not recognizing the I Pod, and I Pod is frozen on the "Do not disconnect" screen. Thanks DELL   Windows XP   3.2 Ghz Pentium D

  • Translation date in MIRO

    Dear experts This is a problem I have read a lot about, but none of the answers work properly and I wanted to create a new thread in order to try to compile a final answer for this problem (at least in version 6.0) As you know Standar SAP uses postin

  • System will not start

    T60 will not start.  While turning on and initiating system, it died suddenly.  Even the battery light was not illuminated.  Battery part# is FRU P/N 42T4504.  Should the system still start with the AC adapter, even if battery has died?  Are others h

  • What does Preview do here?

    I'm working on a project and the behavior of Preview puzzels me. I use a 4x4 png-picture as a background to a matrix I plot. But for some reason Preview decides to smooth it all out. Can somebody help me with that? The second printscreen was taken fr