Open a pdf file to a specific location

Dear friends,

I would like to support a dialog with a help button that needs to open a pdf file to a specific location, is defined by number of page or (better) by named Destination.

var helpFile = File($.fileName.replace (/\.jsx(?:bin)?$/i , ".pdf"));
OpenPDF (helpFile, "FMcalccalculations"); // named dest = M8.newlink.FMcalccalculations

function OpenPDF (fileName, destination) {
  if (fileName.exists) {
    fileName.execute("nameddest=M8.newlink." + destination);
  }
}

This is to open the pdf file on the first page.

How can I pass parameters - not knowing what pgm will open the pdf file (depending on the installation of the user)?

I've seen (IMHO) using an intermediary VBscriptthat crunch, but I have not yet tested this approach. As far as I understand that this would imply a VSscript for each destination in the pdf file.

All ideas are wolcome.

Klaus

Well, friends, I found a solution on StackOverflow.com: in German, we say such a solution 'von fun druch die brust projectiles' fur.

ExtendScript:

// Open PDF at named destination

var theFile = "PDFwithDestination.pdf";           // for my case: in same path as this script
var destination = "M8.newlink.FMcalcseries"       // needs to be found in pdf, because the 8 is not a constant
OpenPdfAtDestination (theFile, destination);

function OpenPdfAtDestination (pdfFile, namedDestination) { // ====================================
var path = GetScriptPath () + "\\";
var location = "nameddest=" + namedDestination;   // see "Parameters for Opening PDF Files"

// Call OpenPdfWithParameters, according to
// http://stackoverflow.com/questions/20862868/file-execute-is-not-executing-my-script-how-to-debug-this-issue/20863131#20863131
// A workaround to pass arguments is to create another file, that calls this script with arguments.
// Yawar 2015-03-15

// Create the calling batch file
var tempFile = File (path + "tempScript.bat");
  tempFile.open("w");
  tempFile.encoding = "UTF-8";
  tempFile.writeln (path + "OpenPdfWithparameters.exe " + '/A ' + location + ' "' + path + pdfFile + '"');
  tempFile.close();
  tempFile.execute ();
  tempFile.delete;
}

function GetScriptPath () { //=====================================================================
// Get the script path
// Returns path in the function
  var scrPath, newPath, winPath, lastBSlash;

// $.fileName: script path (including the file-name of the script)
// platform independent format e.g. /e/_DDDprojects/FM+EN-escript/escript
  scrPath = $.fileName;
  winPath = new File (scrPath);
  scrPath = winPath.fsName;                       // get Windows format
  lastBSlash = scrPath.lastIndexOf("\\");         // \ needs escaping
  scrPath = scrPath.substring(0, lastBSlash);
  return scrPath;                                 // no final \ !
} // --- end GetScriptPath

AutoHotKey script - must be converted into an exe file:

; OpenPdfWithParameters.ahk
; 2016-04-15 Klaus Daube

; Get the arguments from the caller (works only in compiled version!)
parmList =
Loop, %0%  ; For each parameter:
{
  param := %A_Index%
  parmList = %parmList% `n%param%
}
; MsgBox, Number of parameters: %0%`n%parmList%

; let's find the relevant application
RegRead, sDefaultApp, HKCR, .pdf
RegRead, sDefaultAct, HKCR, %sDefaultApp%\shell
RegRead, sDefaultCommand, HKCR, %sDefaultApp%\shell\%sDefaultAct%\command
StringTrimRight, command, sDefaultCommand, 5 ; remove the "%1"
; MsgBox %command%                      ; "H:\Adobe\Acrobat11\Acrobat\Acrobat.exe"

; open the pdf with the parameters according to "Parameters for Opening PDF Files"
Run, %command% %parmList%

This works, however a flicker is created due to the execution of the batch file.

Tags: Adobe FrameMaker

Similar Questions

  • How to open a PDF file to a specific number of page in Safari 8.0?

    I use the command #page = 33 to try to force Safari to open a PDF file to a specific page number. While this works very well on almost all Web browsers, it doesn't seem to work in Safari. What I am doing wrong?

    Thank you!

    The problem is probably with the PDF of Safari plugin, which does not correctly open settings. To be fair, however, is not a part of the PDF ISO specification, but something that Adobe put up on their own in their PDF plugins, so that other applications are not obliged to follow.

    If you switch to using software Macromedia so it should work, even in Safari.

  • Open a PDF file to a specific page of the command line

    I want to open a PDF stored locally to a specific page of the command line. I've seen examples of access files based on the web using http and the #page = parameter, but it doesn't seem to work for a file stored on my local disk.  I want to be able to use VBA in MS Access to control the opening page.

    Hi cfwoodbury,

    When you open a PDF document from a command shell, you can pass parameters to the command to open the switch /A with the following syntax:

    /A "=" ""

    For example:

    Acrobat.exe/a "zoom = 1000" "C:\example.pdf"

    Kind regards

    Rave

  • Cannot open the pdf file. fault of 57?

    file pdf loaded down, but not may not open. lack of 57 back constantly.

    Hello

    1. what version of Windows is installed on the computer?

    2 is the issue specific to this file in particular?

    3. What is the exact error message?

    4. are you save the file on the computer and then open it?

    5. If you are viewing the PDF file online, what browser are you using?

    6. If you are using Internet Explorer, version of Internet Explorer you are using?

    7. what application you use to open the PDF file?

    8. are you aware of any changes made to the computer, before the show?

    Method 1:

    If you use Adobe Acrobat, see the following link.

    Unable to open the PDF

    http://helpx.Adobe.com/Acrobat/KB/cant-open-PDF.html

    Method 2:

    If you view the PDF on the web, go to the following link:

    Cannot view PDF on the web

    http://helpx.Adobe.com/Acrobat/KB/cant-view-PDF-Web.html

    Method 3:

    Uninstall and reinstall Adobe Acrobat Reader and look for the question.

    Uninstall or change a program

    http://Windows.Microsoft.com/en-us/Windows7/uninstall-or-change-a-program

    I hope this helps.

  • You don't have permission to open this PDF file

    Hello

    I have a new system with Windows 7 Pro.

    I can't open any PDF file if they are in the MY Documents folder.  If I use Adobe Reader or Nitro gives me basically the same thing. A setting error warning that I'm not allowed to access this file.

    The strange thing is that if the same file is in a different folder (for example public documents) they open smoothly.

    It is only when the file is located in My Documents they open and only pdf type.

    Any idea how to fix this problem apart from the obvious workaround solution working with other folders?

    Hi Eric,.

    Were there any changes made on the computer before the show?

    Method 1:

    I suggest you to follow these steps to restore the default libraries and see if it helps:

    a. press the Windows key + E to open Windows Explorer.

    b. right click on libraries in the left pane.

    c. click restore default libraries.

    d. check if the problem persists.

    Method 2:

    I suggest you to refer to the articles and check if the permissions are set correctly when files are in the documents folder:

    What to know before applying permissions to a file or folder

    http://Windows.Microsoft.com/en-in/Windows7/what-to-know-before-applying-permissions-to-a-file-or-folder

    What are the permissions?

    http://Windows.Microsoft.com/en-in/Windows7/how-do-I-open-a-file-if-I-get-an-access-denied-message

    Let us know if you need more assistance.

  • When I try to open a PDF file with adobe Acrobat reader Windows Media Center automatically appears.

    When I try to open a PDF file with adobe Acrobat reader, windows media center automatically opens. How to prevent this? I just want to open the PDF file with Acrobat reader.

    The solution I think. If you right-click on one of the files and select open the file locations it now combined the file with adobe reader.

    Yes - you simply need to change the associated file (and path) back to Adobe Reader.  (If that's your choice PDF reader.)

    If you did this:

    Press the Windows Logo and R key at the same time to bring up the dialog box RUN.
    Once you have the dialog box up, type in the following command and press OK...

    cmd /k ftype AcroExch.Document

    That he return with? Should be something like:

    AcroExch.Document = "C:\Program files (x 86) \Adobe\Reader 10.0\Reader\AcroRd32.exe" '%1'

  • When I open a PDF file, I get the following message "invalid plugin detected Adobe Acrobat reader DC will leave" I reinstalled Adobe DC but still the same problem, it happens with all PDFs. Any advice much appreciated.

    When I open a PDF file, I get the following message "invalid plugin detected Adobe Acrobat reader DC will leave" I reinstalled Adobe DC but still the same problem, it happens with all PDFs. Any advice much appreciated.

    Hi Stephen39,

    Do you have any 3rd party plugin installed for Adobe Reader? If not, close all instances of Adobe Reader running and delete the entire folder to: C:\program Adobe [version] \Reader\plug_ins.

    Now go to control panel > programs and features. Locate the entry for Adobe Reader X and choose to repair the installation.

    If you do not have a 3rd party plugin installed, try to uninstall them and see if the problem is related to the same. If it works, let me know what plugins have been the origin of the problem so that I can have a look.

    If all goes well, this should fix things.

    Thank you

    Nicos

  • You use Mac OSX 10.7.5, when you try to open a PDF file, I get a message "an internal error has occurred." I uninstalled and reinstalled both Adobe 10 and 11. Anyone know of the problem and the solution?

    You use Mac OSX 10.7.5, when you try to open a PDF file, I get a message "an internal error has occurred." I uninstalled and reinstalled both Adobe 10 and 11. Anyone know of the problem and the solution?

    Hi Charles,


    It is specific to a particular file or all the files that you are trying to open, gives you the error.

    How you open the same file using Preview on Mac.


    Thank you

    Vikrantt Singh

  • Do Adobe flaw for opening a PDF file

    All of my PDF files in Microsoft Office Picture opened last month. I want to open them in Adobe. (I have XI.) How can I make Adobe default my site to open a PDF file? Help, please. Thank you

    Sue

    Can you please try the steps under Windows XP:

    -Right click on any PDF file, then click 'open with '.

    -Select "Choose the program," even if the PDF Viewer you want to use appears in the list.

    -Click on the PDF Viewer that you would like Windows to use by default when opening PDF documents. If the correct PDF Viewer is not displayed in the list, click on the button "Browse". Navigate to the location of the program on your computer, click on it and click 'open '.

    -Check the box "Always use the selected program to open this type of file."

    -Click 'OK '. The program you have selected now will automatically be used when a PDF file is opened.

  • File to open a pdf file using the links in action

    Hi all

    I am trying to open a pdf file that resides in the following location (/ bishiphome/Middleware/Oracle_BI1/bifoundation/web/app/Hlo/l_en).
    I chose this place just to be sure, there is no access right problem.
    I am able to open any file residing in that folder html by using an action link (URL: http://IPADDRESS:PORT/analytics/olh/l_en/biee0001.htm), but once I try with a pdf http://IPADDRESS:PORT/analytics/olh/l_en/Test.pdf file I get the following error:
    Error 404 - not found
    RFC 2068 Hypertext Transfer Protocol--HTTP / 1.1:
    10.4.5 404 not found
    Server has not found anything matching the request URI
    PS: when I copied the pdf file in the folder that I restarted weblogic.

    Any idea guys?

    Concerning
    Adil

    Hi Adil,

    Place the PDF in /l_en dint record works for me too however, you can place them inside the following paths and restart the services.

    D:\MWARE\user_projects\domains\bifoundation_domain\servers\AdminServer\tmp\_WL_user\analytics_11.1.1\silp1v\war\res

    AND

    D:\MWARE\Oracle_BI1\bifoundation\web\app\res

    You can then call your file with the url http://hostname:port/analytics/res/filename.pdf

    It worked for me, let me know in case of any problems.

    Rgds,
    DpKa

  • 10.1.3 Adobe is unable to open the pdf file in Safari 5.1.5

    All,

    After the Adobe Reader 10.1.3 update everytime I try to pen a PDF in Safari 5.1.5 I get the following window:

    http://msemac.redwoods.edu/~darnold/adobecap.TIFF

    What is going on?

    David

    Hi David,

    Please note that if you use OS X 10.6.x, then you need to run Safari in 64-bit mode. You can do the same in

    1. go into Applications, command-click Safari to open the context menu.

    2. now click on read the information

    3. in the new window that appears, uncheck the box "Open mode 32 bits".

    This is because on OS X 10.6.8 Safari 5.1 in 32-bit mode is not supported. Refer to the release notes for more details on changes to the systems requirements.

    If above information was not useful,

    Please let us know your OS version and the question of whether this problem occurs with all PDF files or any specific file?

    Also try to "Recharge" the PDF file in safari when gray window is displayed by pressing "control + R?

    -Shashi

    Post edited by: Shashi Kant

  • How to open the pdf file residing on the server to the client computer applications?

    Hi all
    The scenario is that I've developed a form using forms10g (9.0.4). I wrote the following lines in the module of the form, there is a button.in the code for this button.
    AppID: = DDE. App_Begin ("C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe C:\2dayDBA.pdf', DDE.") App_Mode_Maximized);
    ConvID: = DDE. Insider ("Acrobat", '2dayDBA.pdf');
    Now when I run the form and click the button, it opens the pdf "2dayDBA.pdf" file and it works fine.
    My problem is that when I deploy the same form on Oracle application server and copy the pdf files in the same location with acrobat reader installed at the same place and run the formula browser client and press
    the button, it does not open the pdf file and gives me the error "Exception no Oracle".

    someone has the solution for this. (don't forget I want to just open the pdf file of the client)
    its really urgent

    Kind regards
    abbasyazdani

    Stop and then restart the OC4J container, and then try again.

    François

  • How to open a PDF file using the built-in Viewer? (Windows 8.1)

    When I try to open a PDF file I have the pop-up dialogue "you have chosen to open *.pdf Firefox do with this file? And display in Firefox is not one of the options. I am sure that what is happening is that there is no dialogue, and the PDF has just opened in the integrated Viewer pdf.js. If something is wrong with my profile I guess.

    I tried the instructions here: https://support.mozilla.org/en-US/kb/view-pdf-files-firefox-without-downloading-them

    I checked through all my extensions and you do not have open a PDF (I have uBlock, NoScript and Zotero).
    I completely uninstalled Adobe Reader.
    I checked that in preferences/Applications, PDF is set to "Preview in Firefox.
    I did as I went through: config and change all settings with 'pdf' on their return to their default values
    But none of these things work.

    Is there anything else I can try to get this working?

    I think the problem I had was that some of the PDF files is served by Web sites with a "header" (I don't really know what that means) called "Content-Disposition: attachment", and when this happens, Firefox refuses to load them into the integrated PDF Viewer. (I don't know why Web sites this.)

    It is very helpful, especially because Firefox gives no indication as to what is happening (why the user preference for a PDF file is not respected). I just thought that the PDF Viewer was broken and spent hours trying to fix it.

    If anyone runs into this problem, there is an extension that fixes it: https://addons.mozilla.org/en-us/firefox/addon/inlinedisposition/

    There is a Bugzilla bug open about it: https://bugzilla.mozilla.org/show_bug.cgi?id=773942

    As far as I can see, it would be trivial reflect changes the extension above in Firefox. In the bug of no claim that it would be a bad thing to do for safety reasons. But Firefox should at least present the user the ability to open the PDF file in the integrated Viewer or even more at least have explanations on why the PDF is not currently open in the Viewer, for example "this PDF file was marked for download, so for safety reasons it has not been opened in the integrated Viewer. Who would save people like me, who don't know the HTTP headers that are complicated, just think that Firefox is broken.

  • Why does firefox open a non-stop tab string when I try to open a PDF file?

    I don't know if it's a coincidence, but right after that I installed the latest version of Adobe flash player, firefox now opens a string with no end of new tabs, whenever I try to open a PDF file. I have to close the window and start over.

    Help?

    the machine is a HP Elitebook 8540w. Windows 7 64-bit.

    You have configured Firefox to use the Adobe Acrobat plugin? It seems that he may be missing or disabled, because it does not appear in your "more details of the system" (next to your message). You can see the page modules. Either:

    • CTRL + SHIFT + a
    • "3-bar" menu button (or tools) > Add-ons

    In the left column, click on Plugins. Then on the right, look for Adobe Acrobat. It may be down on a gray background.

    If you don't have it: Make sure that this isn't your favorite here player:

    "3-bar" menu button (or tools) > Options > Applications

    You can type or paste pdf in the search box at the top of the list after loading to filter.

    If you have it, but it cannot be activated using 'Always enable' or "Ask to activate": You may need to update. I recommend using the help inside your product Adobe (Reader or Acrobat) menu to check the updates.

    Any progress?

  • Whenever I try to open a pdf file in firefox, he asks me to activate adobe acrobat. How can I stop this from happening?

    I have activate acrobat, but it happens always next time I need to open a pdf file. The same problem occurs when I use a quicktime file. I can down down I would allow me every time but one time, next time, I want to use, see, or hear a quicktime file I get the same question. It's very annoying. I went into options and chose the file to use to open rather than have me ask but it does not solve the problem either.

    Hello moxiet, please go to the firefox menu > addons > plugins where you can set general preferences for individual plugins (always ask or always activate).

Maybe you are looking for

  • When I try to download an add on, I get a message that I need to install FF first

    I have a dozen Add ons that work well. When I try to download another, I get the above message. I can access the site using FF. I tried to re - download FF, but continues to be the same thing. The same issue happened to me in late 2015, but things we

  • Satellite A100-250: A value of bad RAM

    Hello I have a Toshiba a100-250.In addition to the 512 MB ram module, I bought a 1 024 MB module to boost it up a little bit. They are running and DDR2 at 533 mhz. Now the problem is that my computer laptop doesn´t recognizes the two modules. I was j

  • Sony Handycam DCR-HC37 Driver

    Sony Handycam DCR - HC37 Driver for windows xp sp3

  • EliteBook 8530w

    How can I find Australian HP support centre for the EliteBook 8530w drivers or software updates.  Seem to get a 'Chinese' characters on the screen.  Not much help for me.

  • Revrting for Windows 7 Windows 8.1

    My wife recently bought a laptop for use by members of its Steering Group local fair trade for presentations etc. The laptop came pre-installed with Windows 8, but the members of the Steering Group would prefer to work with Windows 7. I bought a Wind