× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



you could have the user click a button in the browser, which runs
javascript, which downloads the PDF into an array buffer in the javascript
code. From there maybe run adobe javascript scripting code to view the PDF
https://www.google.com/search?rlz=1C1CHBF_enUS778US780&sxsrf=ACYBGNS9btJiqK8TJOVZV_Db1UtRv5T82Q:1568774431209&q=acrobat+javascript+scripting+guide+2017&sa=X&ved=2ahUKEwiLutGVrNnkAhUMhOAKHeQKBxYQ1QIoBHoECAsQBQ&biw=1534&bih=706


On Tue, Sep 17, 2019 at 8:16 PM Don Brown <DBrown@xxxxxxxxxx> wrote:

We are running PHP on IBM i

I have added the ability to download/open some documents like statements
as a PDF which works nicely. (We generate the PDF in the IFS with a random
name and then pass the name back to the PHP script.

I am having a problem with controlling how the pdf is to be opened.

I have found that there seems to be two options on the header statement;

header("Content-Disposition: inline; filename=\"$fileName\";" );

or

header("Content-Disposition: attachment; filename=\"$fileName\";" );

Using "inline" opens the pdf in the current browser page and the user has
to click the browsers back button to return to the page where the pdf was
requested from.

Using "attachment" displays a prompt defaulting to download for the user
to save the pdf

What I was wanting to achieve is to have the pdf open in Adobe reader on
the requesting device and if the user wanted to save it then could use the
File ==> Save as option.

Looking for any suggestions or links to more information on how I can
control this ?

Thanks

Don Brown



______________________________________________________________________
This email has been scanned for computer viruses. Although MSD has taken
reasonable precautions to ensure no viruses are present in this email, MSD
cannot accept responsibility for any loss or damage arising from the use of
this email or attachments.
______________________________________________________________________
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.