Show the name of file in PDF file

Hi, hoping for help on what I think is quite a simple question.

I want to create a single blank page PDF file that has a text field automatically and dynamically finished based on the file name of the pdf document. Thus, for example, if the file is named "My sample file.pdf", the pdf file is displayed "My sample file.pdf" and that is all. If I rename the pdf file in Windows Explorer to "My renamed file.pdf", when I then open the renamed "My file.pdf" file appears.

I would then insert this PDF a page in an array of existing pdf files as their new No. 1 page to actually be a title for each page created automatically based on their current file name.

My research suggests that is possible using Javascript in a text field or a form field (although I prefer the text field), however, that I have no experience with Javascript or its implementation of Acrobat, is impossible for me to do. The closest I got is a script that puts the name of the file in the background. Unfortunately this script maintains the new file name that comes to be superimposed on the old watermark of filename, rather that update. For more information the script was: -.

this.addWatermarkFromText({)

cText: this.documentFileName,.

nTextAlign: app.constants.align.center,

nHorizAlign: app.constants.align.center,

nVertAlign: app.constants.align.bottom,

nFontSize: 12,.

({nVertValue: 12});

Ideally, I'd like the script to remove the file extension and if possible to split the output on two lines based on the file name part preceding / fact following a comma in the name of the file (which she would also deprive). For example, if one had a file named 'my sample file created the Monday.pdf', it would display as: -.

My sample file

created Monday

If anyone has any ideas on this, it would be greatly appreciated.

Regards and thanks in advance.

Malcolm Mahr

Add the following JavaScript to the document level:

// Document-level JavaScript code
(function () {

    // Get the file name of this document
    fn = documentFileName;

    // Get rid of the PDF extension
    fn = fn.replace(/\.pdf$/i, "");

    // Replace any comma/space combinations with a carriage return
    fn = fn.replace(/\, /g, "\r");

    // Set the field value
    getField("fn").value = fn;

})();

Replace "fn" in the statement of getField with the name of your multiline text field. This code runs when the form is opened. If you want to be updated when the file is saved, you can also place in case the Document were spared. Note that some operating systems and other things may have a problem with a comma in the name of the file. Underscore would be a safe alternative.

Tags: Acrobat

Similar Questions

  • After playback of MP3 files, random symbols will then show the name of file in XP

    Basically I'm on Xp, service pack 3 and for a while now, from time to time when I played usually a mp3 or other similar in windows media player, 10 minutes later it will pick a random file from my music folder and add a Japanese symbol at random at the end of the file name.

    Like "be the one" is played, 10 minutes later "be [a]" will now be the file name, only it never appears as the actual symbol, just a square, until you see the name on the windows media playlist where she will be written correctly
    So random, files are defined in the standard. Any help

    Hello again once, yes I ran the scanner.

    My avg updates automatically and I manually ran the update function, and it IS up to date
    I also managed to clear Media Player cache by entering the file manually.
    And as for now the problem disappeared, but as I said earlier, he arrived at random intervals and sometimes takes minutes so he could arrive and sometimes takes weeks. So I'll come back if it comes back. But so far no there no return
    Thank you for your hard work and dedication
  • File extension of the show under the name of file in Explorer Win7

    After the switch to Win7, trying to get my setup as I had with XP.
    I can't see how to add the name of file name extension to be part of the file name, and I don't mean in the Type column.
    I need to know if a file is a .htm or a .html, very important with some servers.
    Thank you.
    Don

    Go to the Control Panel

    Select Folder Options

    Select the view tab

    down and uncheck Hide extensions of known types.

    Click OK

  • How to display the names of files without the letters of the index? "A", "B", "C", ...

    Acrobat on the ipad dispays lines with 'A' 'B' 'C' between folder names lost limit screen space.  How can we just display the names of files?

    Currently:

    < local ipad-PDF files

    A

    Apple

    Arnie

    B

    bike

    books

    C

    cards

    Preferred:

    < local ipad-PDF files

    Apple

    Arnie

    bike

    books

    cards

    Hi John,.

    Can I know how many folders/files are there in the folder "ipad-pdfs" because if the number of files/folders is above 13 in the list, then it will display the letters of the index otherwise it won't.

    Let me know your results.

  • Displaying the names of files in the library, view Magnifier Module

    How to display the names of files in the library module, see Magnifier

    Tim

    Hi takavulla,

    You can go to "View > Loupe Info > Show Info overlay" to bring up the name of the file. Otherwise you can just the "I" type key.

  • show the paths of files database tablespaces

    Note this system "dba_tablespaces" view does not show tablespace names of file and folder paths.
    How can I ask what database tablespaces have and in the files of the OS also .dbf files looking for?

    (Oracle 10g, Linux OS.)

    Check v$ datafile and v$ tablespace, join on TS #.

  • How to make a folder shows the number of files in there?

    How to make a folder shows the number of files in there?

    You have not indicated what OS you are using.

    Yosemite

    Action > View Options: Select to display the item of information

  • Can I globally change the names of files and or directory to lowercase to uppercase?

    in Windows XP or in Windows 7, globally change the names of files and or directory to lowercase to uppercase?

    A single configuration change probably will not accomplish this.

    Your best bet is probably the freeware "Bulk Rename Utility" program which has a section dedicated to change the case of file names.

    Bulk Rename Utility: <> http://www.bulkrenameutility.co.uk/Main_Intro.php >

    HTH,
    JW

  • Want to copy and paste the names of files only, not the content

    I have organized hundreds of files in several folders of dozens and that you must first create a list or map of all files.  I want only the names of files, not other thing.  I found some freeware that seems designed to do this, but am reluctant to download.  Can it be done without additional software?  If I can't do the regular windows environment, someone suggest what software is the easiest to achieve?

    There are a lot of reliable freeware websites.  What program have you found, and this web site is on?

    To do the work of the normal Windows environment, click Start > all programs > Accessories > command prompt and enter these commands:

    CD /d "" path ".
    dir/b/s >"" file
    ".

    where:

    path = full path to the file
       file = name of the file to write

    For example, to create a list of files in My Documents and write it to a file named My Documents.txt :

    CD/d "C:\Documents and Settings\Utilisateur\Mes Documents"
    dir/b/s > "My Documents.txt."

    The /s parameter lists the files in the selected folder and all its subfolders.  The omit if you want just the files in the selected folder. Boulder computer Maven
    Most Microsoft Valuable Professional

  • How can I print a list of the names of files on a hard drive

    I try to print the names of files on drive "C".

    Hello

    Use this excellent free program.

    Karen - free directory printer - print the name of every file on a disk, as well as the size of the file, date and time
    last modified and attributes (read-only, hidden, system and Archive)! And now, the list of files can be
    Sort by name, size, date created, date last modified, or last access date.
    http://www.KarenWare.com/PowerTools/ptdirprn.asp

    I hope this helps.
    Rob - bicycle - Mark Twain said it is good.

  • Unable to save the name of file in Notepad with * (asterisk)

    We are unable to save the name of file in Notepad with * (asterisk)... with this offer special symbol... why?

    I had to ask about the asterisk "" * "symbol..."

    The asterisk is also a special character that cannot be used in a file name or a folder.

  • highlighting the names of files in Explorer


    Is there a way to clear or color code of the names of files in windows Explorer?

    Hi Ron,

    Please contact Microsoft Community.

    I understand you want to know the possibilities by highlighting the names of color code file in Windows Explorer.

    It is not possible to design problem. I suggest you use your favorite search engine to search for any third party software that can help to correct the problem.

    WARNING: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    I hope it helps. If you have any questions about Windows in the future, please let us know. We will be happy to help you.

  • How to export all the names of files in a folder to simple text file.

    Hello Expertise,

    I am trying to load the names of files in the folder to a table in ODI. then load the data from there to a single table.

    I am able to load the data from 100 files in a folder. using the concept of loop (used ODI gurus: SEVERAL FILES - TARGET SINGLE TABLE - SINGLE INTERFACE link to do this, but right now I need to insert the names of files manually to a table. ) My Question is "is there any jython script or procedure to load all the file names to single table with FILENAME column. ???


    If it please help me do this.


    Thank you

    Shakur

    Hi Shakur,

    Yes you are right... The operating system command should be part of the automated process, I mean if you combine these file loading process (Interface, procedure, etc.) in a package of ODI, then the command BONES to get all the names of files in the FOLDER should be one of the steps in the package of ODI. For this, you can use ODI OS command component.

    Kind regards

    Parag

  • What is the name of file Loader (FBL) for the loading of languages to the employee?

    What is the name of file Loader (FBL) for the loading of languages to employees?

    Hi, the best place to search for questions like these is OTN, Oracle Technology Network. If you have any questions about the CLOUDS and in partnership with Oracle, we will be more than happy to help! Thank you!

  • 5.7 LR is no longer exporting files jpg (from RAW). No error message, just "finished work". No way around changing some options for export as the name of file, image size...

    Why is 5, 7 LR is no longer exporting ALL files jpg (from RAW)?

    No error message, just the usual "finished work" - but without actually writing a jpg file.  No way around changing some options for export as the name of file, image size...

    Hi antjeh37833361,

    Could you please export a Jpeg image and see if it exports.

    Also try to export the RAW image in Jpeg format on the desktop and then see if it exports.

    Please upgrade to the latest version 5.7.1 if Lightroom you are currently on 5.7

    Kind regards

    Tanuj

Maybe you are looking for