I keep receiving security errors when trying to open a pdf.

I keep receiving a security error when trying to run my javascript program, the function previously worked, but now creates an error after I entered the addWaterMark function. I have put my whole code below for my script.
The basic function is to load a text file into an array which has the path and file location, open the document, add a watermark, save the file, close the file, then repeat for the next array position.
I am using Acrobat Standard so I am unable to debug using the console, therefore I am struggling to understand what I am doing wrong. I will point out that I am not a fluent programmer, only have a basic knowledge of programming.
Code
app.addSubMenu(
  cName:"Extras",
  cParent:"Edit"
app.addMenuItem(
  cName:"Import File",
  cParent:"Extras",
  cExec:"main()"
function main()
  var fileCount = 0
  var listOfFiles = []
  listOfFiles = importData()
  amountOfFiles = listOfFiles.length
  for (var i =0; i<listOfFiles.length; i++)   //calculates amount of entries in the array listOfFiles
  newFile = openFile(listOfFiles[i]) //Opens current file
  var d = app.activeDocs; //Gets current document title name 
  addWater(d[0]);
  app.execMenuItem("Save");
  for( var x in d ) d[x].closeDoc();
function addWater(myName)
{ app.alert("watermark",0);
  myName.addWatermarkFromText(
  cText: "OBSOLETE",
  cFont: "Arial",
  nFontSize:36,
  aColor: color.red,
  nOpacity: 0.5
//function SaveFile saves the current file but with an addition of WM to the filename
saveFile = app.trustedFunction(function(currentDoc, currentFileName)
  { app.alert("savefile",0);
  app.beginPriv();
  currentDoc.saveAs(currentFileName);
  app.endPriv();
//function openFile which opens the file named in the variable currentFilename
openFile = app.trustedFunction(function(currentFileName)
  {app.alert("openfile" + currentFileName,0);
  app.beginPriv();
  app.openDoc(currentFileName);
  app.endPriv();
//importData function imports the paths and filenames contained in the list.txt located on the desktop
importData = app.trustedFunction(function()
  {app.alert("import",0);
  app.beginPriv();
  cFilePath = "/C/Users/103019944/Desktop/File_List.txt";
  var stmData = util.readFileIntoStream(cFilePath);
  var cData = util.stringFromStream(stmData);
  var cMsg = cData;
  var fileArray = cMsg.split("\r\n");
  for (var i =0; i<fileArray.length; i++)
  return(fileArray);
  app.endPriv();

I have found the error, you are quite correct I had an extra letter in the filename, I thought I'd checked this but just shows that sattention to detail is the key.
The script works perfectly now, thanks you for your help, really appreciated.
Thanks again
Ben

Similar Messages

  • HT4539 I keep receiving this error when trying to open the itunes store (We could not complete uour iTunes store request, an unknownerror occured (0x80092013).

    cant complete your itunes request unknown error occurred (0x80092013)

    cant complete your itunes request unknown error occurred (0x80092013)

  • I received an error when trying to open itunes

    I received an error when trying to open itunes.  It said itunes stopped working, so I tried to uninstall and re-install.  It let me install it, but when I tried to open it, it gave me the same error message.  How can I get itunes back on my laptop (windows).

    Perhaps is post what the error is someone might be able to offer assistance.
    Also, have you had a look here  >  http://www.apple.com/support/itunes/troubleshooting/

  • I get the following error when trying to open a pdf file... '*pdf.part could not be saved, because the source file could not be read"

    I get the following error when trying to open a pdf file... '*pdf.part could not be saved, because the source file could not be read". I am able to open pdf files in IE and other programs.

    I am encountering the same problem -- though with .qfx files from my bank. This worked fine in Firefox 31 ESR, but since upgrading to Firefox 33.0, I get the "<name>.qfx.part could not be saved, because the source file could not be read" when I attempt to download. (I should add that downloading PDF statements from the same site works fine, and that the qfx downloads work fine in IE and Chrome.)
    I tried safe mode, it is still broken. Tried v34 beta, no luck. I reverted to version 31, it works again.
    I guess I will stick with the older version until a solution is found...or just use an alternate browser to download my financial data.

  • "The file is damaged and could not be repaired" error when trying to open a PDF in Reader

    A few of our employess (only 3 out of over 100 so far) have been getting the error, "The file is damaged and could not be repaired" when trying to open some PDFs. Other people are able to open the same PDF files with no error. It's happening on about 10% of the time. I've read a bunch of threads here with this isue and tried some suggested fixes and nothing has resolved the issue. Here is what I have found works and does not work and the info on their computers:
    Computers:
    1 Dell Vostro desktop running WIndows 7
    1 Toshiba Satellite C55 runnign Windows 8
    1 Samsung ATIV Book 4 running Windows 8
    All using Adobe Reader XI but we did uninstall that version and tried previous versions and still got the error.
    Did Not Work:
    As suggested by the company that we use online for claims adjustments where this error is occuring, we tried using a different PDF creator since the files were created using a free PDF creator by the employees. PDF995 and PDFcreator (pdfforge) did not resolve the issue. I then created the PDFs with my Adobe Acrobat, uploaded from my computer to the online program, and that did not resolve the issue.
    Saving the file to hard drive and then opening in Adobe did not work.
    Turning off Protected Mode and Enhanced Security did not work.
    Compatibility View settings enabled in Internet Explorer 10 did not resolve the issue. The previously mentioned claims adjustment software company we use online was code for IE so is not fully compatible with other browsers.
    That being said I did try to open the PDF files in Chrome and it also did not work. Same error message.
    Does work:
    I download the file they cannot open onto my hard drive, open in Adobe Acrobat, Save as a pdf, then email it to them and they can open it via email attachment.
    If they close the error and continue trying to open the file over and over sometimes it will eventually open.
    Is there a setting in Windows that is preventing them from opening a small % of files some of the time? Thanks in advance for any help!
    James

    If anyone is reading this still looking for what caused the issue and how to fix it here is what I discovered.
    The antivirus program our company uses, Bitdefender Antivirus Plus, was causing some of the PDF files not to open. After troubleshooting the different modules and settings the culprit was..
    Scan SSL in Privacy Control Settings. Turning it OFF solved the problem and all the PDF files that previously would not open now open just fine. This issue has been sent to Bitdefender for them to review. If you use a different antivirus program and are having this issue try locating the Scan SSL setting and see if turning it off solves the problem.

  • How Do I Resolve FileOpen Client Errors When Trying to Open a PDF in Acrobat X or Reader XI?

    I am trying to open some pdf files received from a client that when I try to open them, I receive an error stating, "The FileOpen client has encountered an error.  Please try to re-start  Adobe Acrobat / Reader."  A co-worker was able to open the same files with his version of Acrobat X Pro.  I am not having success whether I use my version of Acrobat X Standard or Acrobat Reader XI; I get the same error with both application.
    Any ideas how to resolve this.
    Thank you.
    Steve

    FileOpen is a security add-on, which is needed to open some files. Not a part of Adobe software. Maybe you need to upgrade or report it: http://www.fileopen.com/

  • I get an error when trying to open certain PDF files in Lion on Mac.

    I am having trouble opening CERTAIN .PDF files on my MacBook Pro. I am running Lion. The file is attached to a Gmail message as a standard .PDF file.
    This is my error:
    "File "XX" cannot be opened. It may be damaged or use a file format Preview does not recognize."
    I have also downloaded Adobe X reader to see if the compatibility issue is just with Preview. I get an error that the file is "damaged" and cannot be recovered. Meanwhile, the file downloads/opens just fine on Windows XP Office and iOS (on my iPad). So I am thinking that it must be some sort of compatibility issue with Lion.
    So far, other .PDF files open on my MB Pro. I haven't tried all of my saved .PDF files, but I did try a couple.
    Anybody have any suggestions? There seems to be an error with this particular file opening in Lion, but not with the same file opening on another operating system.

    The issue mysteriously resolved itself. I shut down the computer, and the next day I booted back up and tried to open the same file, and everything was OK. Very bizarre, since I had opened it previously on this same MacBook. Anyway, anyone have any insight into what happened?

  • Keep getting security error when trying to update itunes to 11.2.2

    need some help here..............even the manuel download only does not work

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

  • I receive an error when trying to open FireFox "Your Firefox profile cannot be loaded. It may be missing or inaccessible." HELP

    I have never used FireFox on this computer and ge the error Your Firefox profile cannot be loaded. It may be missing or inaccessible.
    I have tried most suggestions no help.

    Try:
    *http://kb.mozillazine.org/Recovering_a_missing_profile
    Create a new profile as a test to check if your current profile is causing the problems.
    See "Basic Troubleshooting: Make a new profile":
    *https://support.mozilla.org/kb/Basic+Troubleshooting#w_8-make-a-new-profile
    There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins" in case there are still problems.
    If that new profile works then you can transfer some files from the old profile to that new profile, but be careful not to copy corrupted files.
    See:
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • Keep getting 404 error when trying to open safari

    help me get ride of this problem

    Quit the application. Force quit if necessary. Relaunch it by holding down the shift key and clicking its icon in the Dock. If there's no change, reset your home page in the General tab of the preferences window.

  • I keep receiving this error every time I open LR, "Lightroom encountered and error when reading from its preview cache and needs to quit" and the app won't open. It said LR would try and fix this error next time I opened it but the error remains. I tried

    I keep receiving this error every time I open LR, "Lightroom encountered and error when reading from its preview cache and needs to quit" and the app won't open. It said LR would try and fix this error next time I opened it but the error remains. I tried uninstalled and installing the app and the error remains. I have windows 8. Can anyone please help???

    Use Windows Explorer to open the folder containing your catalog. The normal location is Pictures\Lightroom. Locate a folder with the extension .lrdata and delete that folder. Then you should be able to start Lightroom again, and Lightroom will begin building and new previews folder. Do not delete anything else.

  • I keep getting an error when trying to receive the new update iOS7 on iPhone5.  Any suggestions?

    I keep getting an error when trying to receive the new update iOS7 on iPhone5.  Any suggestions?

    Do the update using iTunes on your computer.
    Plug your iPhone into iTunes (current version), let it sync, then click "Check for Updates" on the iPhone's summary page in iTunes.

  • Receiving an error when trying to remove P00 Security role from the user

    Hi All,
    I am receiving an error when trying to remove P00 Security role from the user.
    After logging on to GRC CUP, clicking on u201CCreate requestu201D, and filling out required information,
    I click on Select Roles/Groups
    On the next screen,
    I click on Existing Roles/Groups
    ERROR MESSAGE appears X Action failed and no roles appear in the box to select for removal.
    Regards,
    Vineet

    Hi Vineet,
    My be your selection is incorrect
    Try this
    in Applicaiton Area -- Select ALL
    Functional Area  -
    Select ALL
    Company           -
    Select ALL
    Role/Profile/Group Names --- Give p00* and execute the report
    if you give only p00 it wont give any result
    Hope this helps
    Thank you,
    Kishore

  • FireFox keep saying "unexpected error" when trying to print web pages.

    FireFox keep saying "unexpected error" when trying to print web pages. The print preview works OK, but when you try to print that "unexpected error" jumps up.
    Please email me on what to do to get FireFox to work.
    I don't see anything in the FAQ that might help me.

    Hi,
    Please also try this setting: Windows start menu or Control Panel > '''Devices and Printers''', right-click the printer > '''Printer properties''' > '''Advanced''', and select '''Start printing after the last page is spooled'''. In this case you can also close Firefox after spooling is over (usually much faster than direct printing), and printing will continue.
    Also as a general case, if you have security software (antivirus, firewall etc.) installed, you can try deleting all existing instances of Firefox and its related processes/files in all the different configuration modules/areas of the security software like process monitoring, sub/spawned process control, virtualization, HIPS etc., in addition to the security software's main configuration panel. Instead create new fully allowed/trusted rules for Firefox + its related processes in all the different modules/panels - a genuine/original Firefox installer as well as all the installed EXEs (Application) and DLLs (Application extension) are digitally signed by Mozilla Corporation (right-click > Properties > Digital Signatures). Even otherwise, some security software may also ask again when Firefox and/or its sub processes are started, and you may be able to allow/trust at that time. Please see [https://support.mozilla.org/en-US/kb/Firewalls this].
    [http://kb.mozillazine.org/Firewalls AV/Firewalls Configuration]

  • I keep getting an error when trying to update an app- cannot connect to store. I logged out from my account and tried to log back in and got the same error. I am doing all this from my phone since I no longer own a personal computer (only work)

    I keep getting an error when trying to update an app- cannot connect to store. I logged out from my account and tried to log back in and got the same error. I am doing all this from my phone since I no longer own a personal computer (only work) since I use iCloud and I tunes match

    YAY!!! Saved it in my Mac's Firefox Bookmarks for easy future access!
    Hope you are having a lovely afternoon today! I'm about ready to go bobo....I have an early meeting, and I don't want to oversleep! The nice part is that I work remotely, so I only have to wake up 15 minutes or so before the meeting.... I don't even use an alarm clock anymore (really, my iPhone alarm, which is much more pleasant), unless I have to get up at 6:30 or something....
    TMI?
    GB

Maybe you are looking for