Display Filename in PDF File

Hi there, hoping for some help on what I think is quite a simple issue.
I want to create a blank single page PDF file which has a text field automatically and dynamically completed based on the file name of the pdf document. So for example if the file is named "My Sample File.pdf", the pdf file will display "My Sample File.pdf" and that is all. If I then rename the pdf file in Windows Explorer to "My Renamed File.pdf", when I next open the file it will display "My Renamed File.pdf".
I would then insert this one page pdf into an array of existing pdf files as their new page no1 to effectively be a title page for each created automatically based on their current filenames.
My research suggests this is possible using Javascript in a text field, or a form field (although I would prefer text field), however, as I have no experience of Javascript or its implementation within Acrobat, is proving impossible for me to do. The nearest I have got is a script which puts the filename as a watermark; unfortunately that script keeps overlaying the new filename over the old filename watermark, rather than updating it. For information that 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 would like the script to strip the file extension and if possible split the output onto two lines based on the filename portion which preceeds/follows a comma in the filename (which it would also strip). For example, if a had a file which was named "My Sample File, created on Monday.pdf", it would display as:-
My Sample File
created on Monday
If anyone has any ideas on this, it would be greatly appreciated.
Regards and thanks in advance,
Malcolm Dowers

The easiest way to fix this problem is to edit the current javascript.
find the line:
var strLabel = global.FileNameStamp.strDocStamp.replace(/\n/g,"\r");
Place this line underneath it:
var strLabel = global.FileNameStamp.strDocStamp.replace(/\.pdf$/i, "");
So you get:
var strLabel = global.FileNameStamp.strDocStamp.replace(/\n/g,"\r");
var strLabel = global.FileNameStamp.strDocStamp.replace(/\.pdf$/i, "");
That's it!

Similar Messages

  • I am programming a DVD-Rom in DVD Studio Pro 4 and need to display and open pdf files, any suggestions?

    I am programming a DVD-Rom in DVD Studio Pro 4 and need to display and open pdf files, any suggestions?

    http://documentation.apple.com/en/dvdstudiopro/usermanual/index.html#chapter=22% 26section=9%26tasks=true

  • Hi,how can i change the default settings on my adobe readerX1 such that it will display all my pdf files according to their individual cover pages (as cover picture thumbnails)before i click them to open and read........i really enjoyed this feature as a

    hi,how can i change the default settings on my adobe readerX1 such that it will display all my pdf files according to their individual cover pages (as cover picture thumbnails)before i click them to open and read........i really enjoyed this feature as a default settings upon installation in previous editions of adobe reader .i use a windows 8 pc now.thank

    For sideloaded content the nook pulls the metadata from ePub file itself.  I would suggest looking at a program like Sigil or Calibre that will let you edit the metadata in the book to make it appear like you want.
    For the PDF vs ePub - No, that's the way PDFs work (think of them as graphics, not text), wheres ePubs are Web Pages - so  no you can't them to behave exactly alike without converting the files.

  • In a FM 11 book, how can I display filename w/o file location?

    In a FrameMaker book, how can I display filename without the file's  location on the hard drive?
    For example, The book would list:
    "MyFile.fm"
    instead of
    C:\windows\documents\Framefiles\XYZ Company\widgets\draft_2013_1111\MyFile.fm
    If this cannot be done, then how can I get the book to list a name for the added file other than the name of the first heading in the file contents?

    Check out the little toggle icon beside the magnifying glass in the book tab – you can swap back and forth between “Display Heading Text” and “Display File Names”

  • "The exception unknown software exception (0xc06d007e) occured in the application at location 0x7c812aeb" - error displayed when opening PDF files. What i do?

    "The exception unknown software exception (0xc06d007e) occured in the application at location 0x7c812aeb" - error displayed when opening PDF files. What i do?

    What is your Reader XI version?
    Have you tried to disable Protected Mode [Edit | Preferences | Security (Enhanced)] ?

  • Display all my pdf files according to their individual cover pages

    hi,how can i change the default settings on my adobe readerX1 such that it will display all my pdf files according to their individual cover pages (as cover picture thumbnails)before i click them to open and read........i really enjoyed this feature as a default settings upon installation in previous editions of adobe reader .i use a windows 8 pc now.thank

    Moving to .NET support forum.
    To answer your question; yes, in a WEB app using the DHTML viewer. Go to the properties of the Crystal Reports viewer. Find the property "SeparatePages". Set this to false. There is no such option in a WIN app.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • Display of a PDF file

    Hi
    I have an application in which click of link opens a PDF File in same window. So I want to display PDF file in a View. For this I want to use a PAR file,in which i keep my PDF file in one of the folders under PORTAL-INF. and then on click of link i'm able to open the PDF file in the same window.
    Can some body tell me how to go about this.
    or somebody can tell me better approach to this.
    Thanks in advance
    Srikant

    When you have a file inside the par-file (not inside the PORTAL-INF directory), then the url to this file is http://portal:50000/irj/portalapps/par-file-name/filename
    Example:
    com.test.par contains /test/testfile.txt
    then url is http://portal:50000/irj/portalapps/com.test/test/testfile.txt
    In SAP Developer studio project, these files are located in the /dist direcotry in the project.
    If you want to have the file in the PORTAL-INF directory, you can code portal component, which returns the file as content.

  • Display reports on PDF file on the client.

    I'm generating reports on web enviroment.
    I want to know how to display the report output on the client using a pdf file?????. Because by default the server generate an html file displayed on the web browser.
    David Alarid.

    Add "desformat=pdf" to your URL. Typically you're URL will look like:
    http://<server>:<port>/reports/rwservlet?report=<reportName>&destype=cache&desformat=pdf&...

  • I can't get my print widget to display certificate in PDF file, need help.

    I can get my certificate to display with all the variables on the slide, inserted my print widget which asks for a location to save the pdf file. I save it, open it and its blank.
    Any suggestions?

    Centering an entire page's worth of content is pretty simple, but not as simple as adding align:center to the css of every element.
    You likely need to remove a bunch of stuff from your css if that's what you were trying. Seeing the page is going to be the best way to tell you how to fix it.
    Many people will use a container like <div id="wrapper"> to center their page, so that's what I'll use in the example. Here is the css that would go in your page's <style> tags, or in your external .css file...
    #wrapper {
         width:950px;
         margin:0 auto;
    Then in the html...
    <body>
    <div id="wrapper">
         all of your page's content
    </div>
    </body>
    What this does is creates a 950 pixel wide wrapper around all of your content (the pixel amount isn't as important as the fact that there is a width that is less than 100%). The browser then sets the left and right margin to the same setting using all of the available horizontal space by setting the left and right margins to auto. Basically, if the browser viewport is wider than the wrapper div (anything more than 950 pixels in this example), the left and right margin will split that remaining amount between themselves and center your content.

  • Problem displaying characters from pdf file in Preview.app

    Hi,
    I hope someone can help with this problem.
    I have some issues with the display of pdf files on OSX. The problems are with ligatures like 'fl' which Preview.app displays incorrectly as 'oeu'. There are other symbols which Preview also displays incorrectly.
    This problem is not affected by cleaning the font cache and as far as I can tell all the fonts are present and correct. I am guessing the problem has something to do with Preview finding a different version of the Times or TimesRoman font than Adobe Reader uses, and so it gets the wrong symbol, but I'm not sure.
    How can I ensure that Preview uses the same fonts as Adobe Reader? and how can I get Preview to render my pdf's correctly?
    Here is a sample of the problem with Preview.app (4.1):
    !http://farm4.static.flickr.com/3456/33599073294296beb1a8m.jpg!
    and with Adobe Reader (9.0.0)- correctly rendered:
    !http://farm4.static.flickr.com/3448/335990717548aa12e576m.jpg!

    My computer automatically open PDF inside the Safari
    window, but I wish it would go back to opening it
    externally via Adobe. (maybe we should trade
    computers:-)
    Anyway, we have the same question.
    How do we control whether PDF launches internal to
    Safari, or external in Adobe?
    This is what I would like to as well. I often have a lot of pdf files I need to open and then save to my hard drive. When I click on a pdf file on a website Safari opens it and then I need to right click in the document to open it with Adobe. How can I get it to open in Adobe the first time without having to right click after it opens in Safari?
    Thanks!

  • Displaying byte array PDF file in Portal

    Hi,
    i need to display a PDF file. The PDF is stored in a byte array. This works fine when i run my code (see below) from the .jpf via the debugger/browser, but when i use it as a portlet, in the portal, it does not work ?
    Any help is much appreciated.
    Thanks
    Mark
    byte[] pdfDocument = docStore.getPDF();
    ServletOutputStream outPdf = response.getOutputStream();
    response.setContentType("application/pdf");
    outPdf.write(pdfDocument);
    outPdf.flush();
    outPdf.close();

    Mark,
    Note that the portal sets the content type (e.g, text/html) and encoding
    as the portal page starts rendering. In your case, the
    setContentType() would be useless since the servlet container won't let
    you change it. You can either use a popup browser window for the pdf as
    Kunal suggested, or use an iframe if you want to render the pdf inside
    the portlet window.
    Subbu
    Mark Gilleece wrote:
    Hi,
    i need to display a PDF file. The PDF is stored in a byte array. This works fine when i run my code (see below) from the .jpf via the debugger/browser, but when i use it as a portlet, in the portal, it does not work ?
    Any help is much appreciated.
    Thanks
    Mark
    byte[] pdfDocument = docStore.getPDF();
    ServletOutputStream outPdf = response.getOutputStream();
    response.setContentType("application/pdf");
    outPdf.write(pdfDocument);
    outPdf.flush();
    outPdf.close();

  • Grey screen is displayed when loading pdf file in Adobe 11

    Hi,
    PDF file is not loaded in the adobe reader 11. Some time I am getting the grey screen instead of the pdf file. Some time my application is displaying the message saying that It is stopped working. its happening sporadically. But if I downgrade the Adobe reader to version 9, I am not getting the above said issue. Is this the known issue with Adobe reader 11. If it is known issue, any work around is available for it. Many persons using our product got affected because of this issue. pls help me to resolve the issue. I have attached the screen shot of the issue.

    Hi,
    I am getting blank screen even If I try open the pdf file from local desktop in the browser. But when I open the local pdf file outside browser I was not able to recreate the issue. But from my application even if I open pdf file outside the browser also (meaning in the adobe reader), I am getting screen. I have attached the screenshot of error I am getting when I try to open the local pdf file. In my task manager I am able to see many process for adobe reader. Even I close the pdf file, the process is not closing.
    Operating System: windows 7
    IE version: 8
    Adobe reader version: 11.0.3

  • My iPad2 does not display greens in pdf files correctly.

    The green areas of photos in some pdf files are displayed as magenta.  Some other areas in the same photos are also displayed incorrectly; light greys are almost black. Exactly the same thing happens when the same files are displayed on my iPhone4.  But, the same files display correctly on my iMac.
    There is also a strong magenta cast in the green areas in jpg files displayed on the iPad2 (same on iPhone4) but, when the same files are displayed on my iMac, the colours are correct.
    Looks very like a bug in iOS.
    Any ideas?

    From the Safari menu bar, select
    Safari ▹ Preferences ▹ Security
    and check the box marked Allow other plug-ins.

  • WEB.SHOW_DOCUMENT sometimes doesn't display the generated PDF file

    Hi all,
    I'm using the following code to generated my report from Forms:<br><br>
    V_REPORT_ID := FIND_REPORT_OBJECT(V_REPORT_NAME);
    V_REPORT_SERVER_JOB:= RUN_REPORT_OBJECT(V_REPORT_ID,P_LIST);
        V_JOB_ID := substr(V_REPORT_SERVER_JOB,length(:GLOBAL.REPORTS_SERVER)+2,length(V_REPORT_SERVER_JOB));
        V_REPORT_STATUS := REPORT_OBJECT_STATUS(V_REPORT_SERVER_JOB);
    LOOP
       IF V_REPORT_STATUS = 'FINISHED' THEN          
          V_TMP_PDF := :GLOBAL.APACHE_HTML_FOLDER ||'rpt'|| V_JOB_ID  ||'.pdf' ;
         COPY_REPORT_OBJECT_OUTPUT(V_REPORT_SERVER_JOB, V_TMP_PDF );
        WEB.SHOW_DOCUMENT(:GLOBAL.AS_HOME_URL ||  'rpt'|| V_JOB_ID  ||'.pdf' ,'_BLANK');     
        END IF;
    END LOOP; <br><br>
    Everything works fine except the WEB.SHOW_DOCUMENT part. In some clients, this command does what it required from it and opens a new browser window with the PDF report displayed on it. In some other clients, this command does nothing: now window dispalyed. When I refer to the Application Server, I see the PDF report successfully generated there. When I put the URL of the generated report manually in the browser address, I can see the report.
    <br><br>
    <b>Why the WEB.SHOW_DOCUMENT doesn't display the generated PDF report in some clients?</b>

    I agree with the previous 2 posters.
    Also firefox and ie handle it differently. Make sure you test on what your clients use.
    Sometimes acrotray.exe is completely retarded and doesn't work.

  • Save as from Acrobat , all filenames read "PDF File"

    Acrobat Pro 9.4.4 has developed a new to me bug.  If I "save as" to a folder containing PDF files all the file names in the window read the file type "PDF FILE" (see the attachment)  however, when I move the cursor on to any file the file name field will show the correct file name.  This also happens when I try to import pages from an exsiting file and is highly inconvenient. This does  not happen with any other  application.  I am running MS Windows 7 home premium.   Can anyone suggest a solution please

    Hi Chaitanya G,
    the pdf retrieved from ftp server should be stored in data type xstring.
    Then
    pdf_content = cl_document_bcs=>xstring_to_solix( pdf_xstring ).
    document->add_attachment( i_attachment_type = 'PDF'
    i_attachment_subject = lv_pdf_subject
    i_attachment_size = pdf_size
    i_att_content_hex = pdf_content ).
    Regards,
    Clemens

Maybe you are looking for