Returning a PDF to the browser
Hi,
We have an ASP the extract data in teh form of XML pass it to AOS (Adobe Output Server) which then render it into a PDF document. What we are looking is basically to return that PDF document to the user browser after the ASP execution.
Any idea how to do that???
Many thanx
Regards
Yasser
You have a several of choices (in decreasing preference):
1) Purchase Adobe Web Output Pak... it was designed to do exactly this and comes with ASP examples.
2) Call JfMerge.exe (the Central Print Agent) directly from the ASP. It will create a PDF file that the ASP will have to copy back to the user.
3) Have the ASP drop the file in Central's collector directory and then wait for the PDF file to show up (no guaranties when it will show up).
Central was primarily intended for batch processing applications and you're describing an on-line scenario. That's why Web Output Pak is better suited for you.
Regards,
Rob McDougall
Indigo Pacific Ltd.
Similar Messages
-
Display PDF on the browser from BLOB column
Hi All,
I have BLOB column in the table where we are storing PDFs.
I want to display PDF within the browser ( not as a download option) from that BLOB column, like clicking on the "Print" link.
Please let me know if anyone has any suggestion.
-SmithCreate this DB procedure:
procedure show_webdoc(io_blob in out nocopy blob
,i_mimetype in varchar2
,i_filename in varchar2)
is
begin
if dbms_lob.getlength(io_blob) >0 then
owa_util.mime_header(nvl(i_mimetype,'application/octet'),false);
htp.p('Content-length: ' || dbms_lob.getlength(io_blob));
htp.p('Content-Disposition: inline; filename="'||i_filename|| '"');
owa_util.http_header_close;
wpg_docload.download_file(io_blob);
end if;
end;Get the blob and give it as input to this procedure. For a pdf the mime type will be application/pdf. -
Acrobat does not opens a PDF in the Browser at all times
Required:
I need to ensure Acrobat opens a PDF in the Browser at all times, and not have Reader hijack the task. All fixes for this I have found won’t work as they render Reader inoperable. i.e. uninstalling Reader or denying users to the Reader executable AcroRd32.exe
Situation:
I have a problem with Adobe Reader and Acrobat Standard 8.2.5. This is on a Terminal Server 2003 with 10 users. They require both Acrobat and Reader be accessible due to specific 3rd party applications related to banking software.
Problem:
They must open PDFs in a browser with Acrobat so they may fill the forms and save them. Acrobat doesn’t consistently open the file; Reader hijacks the file when clicked to open and their ability to fill the forms is hindered.
- Open PDF in browser is checked in Acrobat
- Open PDF in browser is NOT checked in Reader
Sometimes when the Acrobat desktop icon is clicked, Reader opens instead. Having Acrobat open in the background does help but is not consistent.
Also uninstalling Reader from the Server is unacceptable due to a 3rd party banking application for loans. This application is hard coded to open AcroRd32.exe within the application for opening PDFs.
Any suggestions would be greatly appreciated.
KenTry this, when I right clicked on the document to rotate the image a noticed a tool bar appeared at the bottom of the page with the save icon. It then disappeared, but by hovering at near the bottom of the document the tool bar appears and I can save the PDF.
-
How to Open PDF in the browser...JSF
String strUrl = http://..../xxxxxe43cb072378947fe8c1b7bcc7201691a.pdf
FacesContext faces = FacesContext.getCurrentInstance();
ExternalContext context = faces.getExternalContext();
HttpServletResponse response = (HttpServletResponse)context.getResponse();
response.sendRedirect(strURl); Hello,
I have to open PDF in the browser, I am trying to redirect using the above code, but it is throwing exception as below. Could some one help me in this issue?
Thanks In advance
Error Message:
java.lang.IllegalStateException: Cannot forward after response has been committed
Error details:
java.lang.IllegalStateException: Cannot forward after response has been committed
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:313)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
at com.esri.adf.web.faces.application.ADFViewHandler.renderView(Unknown Source)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.esri.adf.web.util.ADFSessionTimeoutFilter.doFilter(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)You cannot send two responses per request. The solution is to let the client create two requests. Common approach is to add an onclick to the commandbutton/commandlink which opens the PDF in a new browser window and let the actual command action invoke a redirect on the current browser window.
E.g.<h:commandLink value="Download PDF" action="#{myBean.action}" onclick="window.open('http://..../xxxxxe43cb072378947fe8c1b7bcc7201691a.pdf');" />where the #{myBean.action} invokes a redirect and the http://..../xxxxxe43cb072378947fe8c1b7bcc7201691a.pdf opens the PDF in the new window.
Edit
I've read your question/problem once more and now I am a bit confused. All you want to do is to open the PDF file in a new window and you don't need to do something in the backing bean? Just use a link with target="_blank".
<h:outputLink value="http://..../xxxxxe43cb072378947fe8c1b7bcc7201691a.pdf" target="_blank">Download PDF</h:outputLink>No need for a redirect here.
Edited by: BalusC on Nov 21, 2007 7:21 AM -
LifeCycle Form Server :- My form is rendering as pdf in the browser without displaying data sometimes within data fields, and at other times it will display data. The form consistently displays data when rendered in HTML.
We display the forms in a browser either HTML or PDF format based on the user selection. But the behavior of PDF format is not consistent. Sometimes it renders properly and sometimes the form renders without data.
Dose any one experienced this issue?
Any help would be greatly appreciated.
Thanks in advance,
RKI have been seeing the same issue, but haven't been able to find a fix for it yet. So any info would be appreciated here too.
Thanks -
I have set the CustWiz/MST to 'Disable and Lock' the ability to display PDFs in the browser. We want them to open separately in Acrobat. After I deploy, the setting IS disabled and locked, but when you click a PDF in the browser, it STILL opens in the browser, and not in Acrobat.
I am pushing Acrobat onto machines that already have Acrobat Standard 9 installed with the same settings. It worked properly then.
What is causing this setting to be ignored? How can I fix it? It's delaying my deployment.
I have to deploy Acrobat 9 due to the bug I discovered here:
http://forums.adobe.com/thread/865843
(With many other frustrating responses).
This is getting a little irritating...
Thanks for any input!
Acrobat Standard X
XP SP3
Firefox 5Thank you for the answer about updating the Foxit plugin. Firefox tags the Foxit plugin as potentially unstable, so it turns out I had another program killing the plugin's startup process so it was always disabled in firefox. I reenabled its startup process and updated the plugin. To get firefox to use it as the main pdf reader I went to options>applications and changed the option for pdf to the foxit plugin and everything works dandy now! Thanks again!
-
Hello
I´m using JavaScript to open a document in the browser using the property Onclick from Command Button: onclick="#{backing_archivos.rutaArchivo}"
and in the backing_archivos.rutaArchivo I have the String window.open("file://c://tmp/document.pdf", "title page", "top=100, left=100")
but the browser doesn't open anything.
What can I do?
Thank.You can do an external file by using a stream and and the response object. I have this in a backing bean, and it gets called with a command button.
public String runQCReport_action()
BindingContainer bindings = getBindings();
OperationBinding operationBinding = bindings.getOperationBinding("PromotionRequestQCReport");
Object result = operationBinding.execute();
FileInputStream bis = null;
ServletOutputStream bos = null;
FacesContext context = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse)context.getExternalContext().getResponse();
response.setContentType("application/pdf");
response.setHeader("Content-disposition","inline=filename=file.pdf");
try {
File fileName = new File("applications/reports/output/PromotionRequestQCReport.pdf");
bis = new FileInputStream(fileName.getAbsolutePath());
bos = response.getOutputStream();
byte[] buff = new byte[2048];
int bytesRead;
while (-1 !=(bytesRead = bis.read(buff,0,buff.length)))
bos.write(buff,0,bytesRead);
//response.getOutputStream().write(yourdata[]);
response.getOutputStream().flush();
response.getOutputStream().close();
context.responseComplete();
catch (IOException e) {
e.printStackTrace();
return null;
} -
When I open pdf files in the browser I do not have a way to save the file as a pdf file on my hard drive. I can only save it as a firefox image file one page at a time. I can't print it either except as individual pages from the image file. When I use the "Save As" icon my only options are to save as a Firefox file. What am I missing? Thanks.
== This happened ==
Every time Firefox opened
== TodayTry this, when I right clicked on the document to rotate the image a noticed a tool bar appeared at the bottom of the page with the save icon. It then disappeared, but by hovering at near the bottom of the document the tool bar appears and I can save the PDF.
-
Best way to display a fillable pdf in the browser?
I am currently using the code below( .net using C#) to display my pdf which is in a memory stream to the browser:
this.Response.Buffer = false;
this.Response.Clear();
this.Response.ClearContent();
this.Response.ClearHeaders();
this.Response.ContentType = "application/pdf";
this.Response.BinaryWrite(byteArray);
this.Response.End();
What happens is I am prompted to open it, and then the pdf is displayed in the browser, however when the user makes changes to the information and then closes the browser, all the information is lost if the user did not save it.
If I add the following line of code in:
this.Response.AddHeader("Content-Disposition", "attachment; filename=" + DocumentToView);
I am then prompted to open and it opens in adobe and if I make changes and close the application, it prompts me to save my changes. However, I still have a blank page being displayed that was processing the initial display of the pdf.
My questions are the following:
1. Is there a way to display in the browser and prompt the user to save changes when they close the browser?
2. Is there a way to get the pdf to display in adobe without displaying the blank page or is there a way to close that page after the document has been loaded?
Thanks
Joe1. Is there a way to display in the browser and prompt the user to save changes when they close the browser?
That would depend on EVERY last browser having identical settings for handling PDFs... not likely, or even probable.
2. Is there a way to get the pdf to display in adobe without displaying the blank page or is there a way to close that page after the document has been loaded?
Without the user saving it... I don't think so.
From a web design standpoint, forcing content or settings on an end viewer is a shoddy practice. If someone WANTS to save the PDF, they will in most cases. Not being able to close the window and/or leave the page containing the PDF without saving it first will ensure more "one time" visitors to the page in question than you hope for. Too many people will misinterpret that as an attempt at loading malware. Correct or not, that will be their perception. -
I also have safari on my computer and if use it and go to the same website I can open the file. there is a similar message if I try to open the file with Preview.
Sounds like the files are corrupt. Time to restore them from a good backup.
-
Incorrect PDF being displayed periodically in the browser
I want to start by thanking anyone who could shed light on this problem.
We have a web application that dynamically generates PDF files per a user request in a web application. 98% of the time the proper PDF gets opened in the browser correctly, whether it be IE or Firefox. The other 2% of the time, no matter what url data was requested from, an incorrect PDF is displayed. This incorrect PDF that gets displayed is one that was requested and opened in a previous request and could still be open in a browser tab. Once this state is reached all PDFs that are requested do not line up with the requested PDF, meaning they are all incorrect. Once the browser is refreshed the problem stops happening for another stretch of time.
I have read posts that discuss placing a random number in the url to "trick" the browser plugin from thinking it already has the PDF. We have done that. In fact this issue appears to not be impacted at all by the url. For example, when this problem happens I can go to https://appname/one/pdf and get the PDF that was requested and sent back when I went to https://appname/two/pdf. These are two clearly different urls even without the random number that we placed on the end as a parameter and I still receive the PDF from the second URL.
We debugged the server side code and we are 100% sure that we are sending the correct PDF back to the client by streaming the PDF to a file on the server prior to sending it back to the client.
One thing I have noticed is that currently we are not specifying the Content-Disposition header when we return the PDF to the browser. This means that there is no filename being provided to the front end and the plugin. Is it possible that the Adobe Reader plugin eventually gets confused as to what file to display if there is no specific file name provided for the PDF from the server, with the keyword there being eventually as it is an intermittent problem?
We can easily set the Content-Disposition header to be attachment; filename="somename.pdf" but given the intermittent nature of this bug we would like to get some feedback as to if this fix is logical given this issue. If it is not logical we would appreciate any other information that may help us troubleshoot this issue. The alternative is to rewrite the document generation code to output HTML, and I really do not want to do that.
We are using the Adobe Acrobat 9.4.5.236 add-on to Firefox 10.0.3, Adobe Reader 9.4.0, and Internet Explorer 8.0.6001.18702. All of these versions are not able to be upgraded, meaning this is the baseline we have to support. We also operate, still, on Window XP Professional Service Pack 3.
One last comment, client side operations by the user are not valid solutions either. I have already suggested asking the user to uncheck the open in browser option in Adobe Reader but our customer does not find that to be a valid solution. To date we have not been able to recreate the issue when the PDF is opened in Adobe Reader proper and not the browser.
Thanks again for any help and information.In case someone, other than me, stumbles across this post. The solution I suggested in the opening post did not work. When a user opens a PDF using the Reader Plug-in in Firefox they still have the potential to see the previous PDF. The interesting thing is, as it appears right now, that this only occurs when a user closes a Firefox tab that contained the previous PDF and then triggers a different PDF to be opened in Firefox. What seems to be happening is that the Reader Plug-in ignores the file it is supposed to open and recycles the PDF that was in that tab before it was closed. Which is funny because the URL of that tab points to the new file that was downloaded into the temp directory but the contents of the tab is still the previous PDF. Not sure if the plug-in just doesn't clean out the previous contents or what but it clearly is an issue that resides in the Adobe Reader Plug-in for Firefox.
I am not sure what we are going to do at the moment but if we find a solution, other than don't open the PDF in Firefox, I will be sure to post it here. However, for right now there is nothing coming to mind. -
Displaying the PDF ByteStream on to the browser?
Hi,
I want to display a pdf on the browser.
I have with me the byte stream, using which I need to display the pdf
directly on the browser.
Currently, I am storing it in my local file system by creating a file
output stream. But its taking a lot of time.
I don't want to create any intermediate files.
Is it possible to display the PDF directly on the browser?
If yes, then can some one point how can this be achieved in SunSeeBeyond......
Regards,
RengaThe questions really are
1."how do I get the web browser to GET a PDF data stream from SeeBeyond"
2."how do I return a PDF data stream from SeeBeyond so that the browser
interprets it as PDF".
Question 2.
PDF data can be supplied to the browser the same as any other content.
Content-type header will be application/pdf - see RFC3778
If your "web application" is completely outside Java CAPS but you need
Java CAPS to provide the PDF data then the simplest thing to do is to
develop a JCD or a BP that uses the HTTP Server eWay, accepts the GET
request, gets the data, sets the data in the HTTP Response, sets the
content-type in the HTTP Response and sends the lot back to the browser.
If you are using eVision then you need to consider where within your
eVision page you would like to display the PDF. A couple of choices are
a) in a popup window, b) in an inline frame, c) in an independent
browser window. In all of these you can specify the URL of the PDF and
the browser will send the GET request to whatever provides the PDF data,
Java CAPS or otherwise. All this has plenty to do with HTTP, HTML and
client-side scripting and rather little to do with Java CAPS. If you
don't understand these underlying technologies you will have
difficulties working out by yourself what can/needs be done.
Question 1.
Again, if your "web application" is developed outside Java CAPS you
cause the link, button, or some such, to get the web browser to issue a
HTTP GET request with the appropriate URL that points to the Java CAPS
infrastructure component that will return the PDF data with the
appropriate HTTP Headers. If your application is eVision-based then
again you need to consider where the PDF content is to be displayed and
get the eVision page to issue the GET request for you, have the pageflow
construct the eVision page so that it embeds the PDF, etc., etc..
All of this is well beyond a simple answer to a simple question. This
takes time to analyse and respond so don't expect a cookbook answer from
anyone. -
When I encounter a site that requires me to fill in a pdf form the browser opens in Adobe Reader and not in the browser. I have checked off in Adobe Reader to open pdf's in browser but it still will not.
I do not think adobe reader works as a plugin for Firefox on Macs, ( but a PC user myself so I can not check). See [[Installing and updating Adobe Reader]]
Note specifically comments in the Mac version of that [/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox?s=pdf+plugin+mac&as=s#os=mac&browser=fx35] about alternative plugins. -
Javascript not working when pdf is rendered in the browser IE9
I have a javascript on the initialize event of a field and it works fine when doing a Preview PDF but not when i render the PDF in the browser
if(F.Page_1.field1.rawValue == null)
F.Page_1.field1.presence = "invisible";
F.Page_1.field2.presence = "visible";
Can some one pelase help?
Thanks,
F.Page_1.field1::initialize - (JavaScript, client)Hi,
The initialize event is supported in browsers, but the issue may be if the form is saved as a Dynamic XML Form in the save-as dialog in LC Designer. Or if you using LC Enterprise Suite to render the forms at runtime, if you have set the render in LC Designer: File > Form Properties > Defaults to Dynamic XML Form:
Changing an object's presence requires a dynamic form.
Niall -
Use Foxit reader in the browser for PDFs.
Hello,
I have set the prefs in foxit to allow "Display PDF's in browser".
I have disabled the Adobe Acrobat Plugin. However, whenI go to make it do the above, there are two entries that look exactly the same. How can I delete one?
I just want to be able to read PDFs in the browser using Foxit...Ooops, take no notice, It seems to have resolved itself. Great. (I hate ACROBAT)
Maybe you are looking for
-
Hi sap Guru's Service Tax payable on Vendor Advances at the time of down payment. Requirement: New tax code X5 need to create with CST@5% on 80% of Bill value and service Tax @12.36% on 70% of Bill value. While calculating the CST amount, system shou
-
GR IR Amount Differences setoff
Hi Good Morning Every one, Here a situation, we have short-billing from the supplier whereby the GR qty is more than the invoice qty and we are still pending billing from the supplier. Here an example of the short-billing: GR Qty:100, IR Qty: 99 the
-
How do you remove a picture from a theme?
Hi all gurus. This must be the most silly question so far in the forum but I have to ask again: How do you remove a picture from a theme? I uploaded a background picture for the Masthead Function Area but now I want to remove it. Since the correspodn
-
Just upgraded to iOS 10.10.2 on my MacBook Pro (late 2011) and was informed my Kindle app was no longer compatible and would be removed somewhere. When I tried to install a new Kindle app from the Apple App store it appeared to download, but when I
-
Can't Print or Save in Adobe Acobat Reader DC
I was using an older version of Acrobat reader and deleted it because it wasn't updating since 2012. I loaded the Adobe Acobat Reader and it will not print or save. Using Mac OS 10.10.2.