Use navigateToURL to open a local pdf...

I have a problem with the following code. I have been searching since yesterday for solutions to open pdfs in a browser window from within flash. I've found various forum posts about using navigateToURL and it looks like people have success. It seems very simple to do, but everytime I try to open the pdf file, i get a 404 error in the browser, which is going to this link:
http://file.pdf (which obviously does not exist)
My pdf file is sitting inside the same folder as the swf that's trying to launch it. Is there a way to use navigateToURL and specify that the file is local? Else, is there another way to open a pdf file from within a folder? Or am I just an idiot and am missing something very obvious?
Thanks for any help,
Chipleh
Code:
myBtn.addEventListener(MouseEvent.MOUSE_DOWN, openPDF);
function openPDF(event:MouseEvent):void{
var url:String = "file.pdf";
var myRequest:URLRequest = new URLRequest(url);
try {
  navigateToURL(myRequest, '_blank');
catch (e:Error) {
  trace("Error occurred!");

Hakan KIRIK wrote: "Have you tried Windows Projector (from publish settings) ?"
Sweeeeet! That works great Hakan, we can certainly use the Flash Projector.
One more solution I just came up with through googler(in case anyone is interested)
-  Create a .bat file and call it from  fscommand:
In Flash:
function openPdf(event:MouseEvent):void{
fscommand("exec", "openPdf.bat");
In your fscommand folder:
Create a .bat file called openPdf.bat with the following contents:
@echo off
file.pdf
exit
For this solution to work, name your pdf 'file.pdf', or change the name in the bat file and place the pdf in your fscommand folder as well.
However, it's alot more work than just calling the navigateToURL funtion, but if you don't want to use a web browser to display your pdf, then the bat file method will work.
Thanks for the solution Hakan, much appreciation,
~Chipleh

Similar Messages

  • IOS: navigateToUrl and openWithDefaultApplication to open a local pdf file

    I tried using navigateToUrl and openWithDefaultApplication methods to open a pdf file on iOS platform.
    Nothing...
    I tried also copying the pdf file to the app storage directory...nothing...
    All goes well on the Mac air app.
    Any suggestion?
    Thanks
    Angelo

    Maybe try using a native extension solution like:
    https://github.com/katopz/ane-device-file-util

  • AS2 with AIR 1.5, code to open a local PDF view

    Does anyone know how to do this. I want to make a simple button that will open a PDF for users to print a file. A button to directly print would be even better.
    Kyle

    Hakan KIRIK wrote: "Have you tried Windows Projector (from publish settings) ?"
    Sweeeeet! That works great Hakan, we can certainly use the Flash Projector.
    One more solution I just came up with through googler(in case anyone is interested)
    -  Create a .bat file and call it from  fscommand:
    In Flash:
    function openPdf(event:MouseEvent):void{
    fscommand("exec", "openPdf.bat");
    In your fscommand folder:
    Create a .bat file called openPdf.bat with the following contents:
    @echo off
    file.pdf
    exit
    For this solution to work, name your pdf 'file.pdf', or change the name in the bat file and place the pdf in your fscommand folder as well.
    However, it's alot more work than just calling the navigateToURL funtion, but if you don't want to use a web browser to display your pdf, then the bat file method will work.
    Thanks for the solution Hakan, much appreciation,
    ~Chipleh

  • Open local PDF inside Air iOS app

    I am developing an AIR for iOS app for the iPad. My client would like the app to open a local PDF file within the app, rather than launching an external app (such as Adobe Reader). This is to give a seamless experience when using the app. I've seen that distriqt.com produce the 'PDF Reader' Native Extension based on www.vfr.org. VFR appears to have a series of interface controls that open along with the PDF, which I don't require. I emailed Distriqt a week ago to clarify, and have had no response.
    Does anyone know of any other solutions to open a PDF inside an AIR iOS app?

    I've managed to load a PDF successfully inside my AIR iOS app, using the code from http://thatsthaway.wordpress.com/201...1/#comment-102.
    However, I've just come across a weird feature / bug when viewing a PDF using stagewebview. I have a PDF that contains several internal hyperlinks, each navigating to a page within the same PDF document. If I select any of the hyperlinks, they do jump to the intended pages. However, if I reselect the same hyperlink again, it no longer works. If I select a different hyperlink, and then reselect a previous link, it will then work, but if I select the same hyperlink twice in a row, without selecting a different hyperlink in between, the link fails to work. The PDF hyperlinks all work ok outside of my app, on both Windows desktop and an iPad, just not inside of the AIR app.
    Any ideas?

  • How to open Password proteced PDFs ?

    Hi,
    I have some work related PDFs with me which are password protected. I can access it via Adobe from my Windows PC at work. At home I usually use Preview to open PDF files, but unable to use it to open password protected PDFs. Any workaround to open them without installing Adobe ?

    I have opened secure PDF files with preview multiple times. I would like to ask you a few questions to get a better idea of what is happening with your situation. With it being password protected is it an automatic authentication that takes place at work, or do you know the password? What happens when you try to open it on your Mac?

  • Illustrator applescript open multi-page PDF error

    Hi all, I am trying to create a script to find and replace objects in a multi-page pdf in Illustrator.  Everything else works except for open and save, which I still have to do manually.  I tried to open the file using the following
    open myFile as PDF with options {class:PDF open options, page:4}
    But Applescript returns the error "Expected class name but found application constant or consideration." 

    Checkout this discussion
    http://forums.adobe.com/thread/499840?tstart=0
    esp the last from Mario Arizmendi

  • I am having problems with the Preview application.  When I try to use it to open a pdf document it gets hung-up and I have to select force quit to close it.   Any ideas on how to resolve this problem?  Thanks for any help

    I am having problems with the Preview application.  When I try to use it to open a pdf document it gets hung-up and I have to select force quit to close it.   Any ideas on how to resolve this problem?  Thanks for any help

    Can you open the Preview program without loading a file, like by itself?
    If it doesn't load then I suspect a corrupt Preview preference file.
    Deleting the System Preference or other .plist file
    Can you open other files with Preview, like jpg's and images?
    How about other PDFs? or is it just that one you have downloaded?
    Run through this list of fixes
    Step by Step to fix your Mac

  • [JS][CS5] how to use bridgetalk to open pdf file through indesign?

    Hi,
    I need help on this:
    I have created a dialog box which has a button and on click of tht button i wanna open an external pdf file using bridgetalk. Or if not bridgtetalk then how to do it?
    Thanks.

    Mark,
    Yes, i would like to open the PDF in system's default reader.
    So how can i do that?
    Thanks.

  • I just purchased Export PDF, and when I use it, it opens them in WordPad (which I never use) instead of Word. Thus, the pictures are not there, and the fonts are changed. How do I get into Word?

    I just purchased Export PDF, and when I use it, it opens them in WordPad (which I never use) instead of Word. Thus, the pictures are not there, and the fonts are changed. How do I get them imported into Word?

    Hi,
    I checked your account,your Export PDF subscription is in 'Pending' status.
    Once it gets confirmed you will be able to use it.
    Please let us know if you require further assistance.
    Regards,
    Florence

  • When I try to open an embedded PDF file I get an error "The program used to create this object is AcroExch.exe.

    When I try to open an embedded PDF file (Word doc) I get an error "The program used to create this object is AcroExch.exe. That program is either not installed on your computer, or is corrupt..."  I've tried  about everything from unchecking
    protected mode at startup to removing & reinstalling Adobe.  Nothing seems to fix this issue.  Any other ideas?
    This is happening on Adobe reader 9, 10 & 11 with MS Word 2010 & 2013.  I've uninstalled, cleaned & reinstalled Reader 9, 10 & 11, as well as Acrobat 10 Pro & 11 Standard.  Removed "Protected mode at startup, and changed
    the default program for viewing from reader to Acrobat.  This will not go away.  It is affecting production at our company.

    " Help > Troubleshooting Information > Profile Directory: Open Containing Folder" . i can't find open containing folder in profile directory. it does give me the option to open the places.sqlite file using graphic converter. when i try that, graphic converter gives me a window saying that it can't be opened because it is corrupted or is not a file type supported by graphic converter.
    i appreciate your help with a workaround to get the old bookmarks. that works. however, the problem has morphed from that concern to why adobe reader [the default app.] won't open firefox .sqlite files. is the problem in adobe reader or firefox? also, how can i tell if the places.sqlite file is corrupt?
    i'm getting in over my head here and do appreciate your help.

  • I have Adobe Acrobat 8 Standard and I had to reload it on my computer due to my hard drive crashing. Now I can only open and view PDF's  and I cannot edit them as I could before such as using Tools Comment

    I have Adobe Acrobat 8 Standard and I had to reload it on my computer due to my hard drive crashing. Now I can only open and view PDF’s  and I cannot edit them as I could before such as using Tools>Comment&Markup or Tools>Advanced Editing>TouchUp Text Tool. All the functions are greyed out. Please advise.

    What's your OS? Acrobat 8 is not compatible with any modern OS.
    On Thu, Jan 15, 2015 at 4:16 PM, thomasc1234 <[email protected]>

  • I used Preview to fill in a .pdf form. I saved it, re-opened and saw my annotations. When I attached it to an email, the annotation and filled-in materials were no there. What's happening?

    Having been gently chided by "How to write a good question," I offer additional information as a preamble to my question.
    I am writing about Preview 7.0 (826.4) on Mavericks 10.9.4; my computer is a MacBook Pro, late 2011 model with not modifications.
    I used Preview to fill in a .pdf form and saved it. To check, I re-opened the form and saw all the info I had filled in. However, when I attached it to an email, the info was not there; the form contained none of the info I had added. I re-did the form several times, but the results were the same when I attached it to email. What's going on?
    Here's a secondary matter. When I filled in the form, the print was red and the type too large. Though I went into fonts, etc. and selected a type size and color black, the info I added was still red and the wrong size. Again, how do I manage color, size, and font?

    Form document will automatically be saved after closing the file. As far as cloud message is concerned, it seems your Mobile link setting has been turned on. When you pressed device back button after filling the form, it was saved to your Acrobat.com account. You can access this document by going to Acrobat.com tab present in left pane. Its a cloud storage area where you can upload/save any document.
    Thanks,
    Adobe Reader Team

  • Open password protected pdf using c

    open password protected pdf using c#...
    we will be providing a pdf path & also its password..
    we need to open it in browser without it asking for password..
    Can this be done.??

    Not unless your budget is in the many tens of thousands of dollars. In effect, no.

  • I switched to mountain lion and from Acrobat pro 9 to 10.  now safari will not open pdf files.  acrobat preferences says it is trying to use version9 to open and i removed version 9.  any ideas?

    I switched to mountain lion and from Acrobat pro 9 to 10.  now safari will not open pdf files.  acrobat preferences says it is trying to use version9 to open and i removed version 9.  any ideas?

    Make sure you have updated Acrobat X to the latest version 10.1.3.  They updated the PDF plug-in in 10.1.1:  http://kb2.adobe.com/cps/837/cpsid_83708/attachments/Acrobat_Reader_ReleaseNote_ 10.1.1.pdf#page=4

  • Open local PDF in browser (Folio)

    I'd like to include a PDF in my publication (local, not online). When you click a button in the publication, this PDF needs to be displayed in the internal Folio browser. Is this possible?

    Zip the file, upload as HTMLResources.zip. the button needs to point to
    "HTMLResources/filename.pdf"
    As far as I can recall.
    —Johannes
    (mobil gesendet)
    Am 12.12.2011 15:51 schrieb "daniel.benjamins" <[email protected]>:
       Open local PDF in browser (Folio)  created by daniel.benjamins<http://forums.adobe.com/people/daniel.benjamins>in
    Digital Publishing Suite - View the full discussion<http://forums.adobe.com/message/4079018#4079018>

Maybe you are looking for

  • How do i get all my music off my ipod and onto itunes on my new computer. it keeps saying that my itunes is on another computer

    I have a new computer and I cannot transfer my music etc on itunes as it says it is already on another computer. Can anyone tell me how to do this?

  • Material Condition record.

    Hi Experts, I'm booking some expenses form purchase order where as this expenses will have fixed price, so I wan to maintain the condition record for the Material with out Vendor.When ever I raise a purchase order the sys should default the price irr

  • Imessage fonts won't change

    I have a new imac--mountain lion--used it a couple times in iMessage and was able to adjust the font size.  All of a sudden it reverted to a small font and when I click on the change font button, it is selectable but does not give me the screen to ch

  • Webdynpro ABAP export/import

    Hi, I have create a webdynpro application with SAP Netweaver 2004s an I will use this application on a portal with SAP Netweaver 2004. How can I get the files in the other system? Can I do this with download/upload or transport ?

  • Requirement in thousands, rounding off's and no decimals

    Hello, I have a requirement in BPC 10 NW to load figures in 1000's and without any decimal places. The customer doesn't want decimal places and rounding off's to the nearest integer. Can anyone guide me on what would be the best option to go about ?