Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Prevent new pdf window and/or close submit connection without extra prompts

Posted on 2008-10-21
6
Medium Priority
?
195 Views
Last Modified: 2012-05-05
Hello all.  I have been able to submit a pdf file to a web server using the php code below.
<?php
$fptr = fopen("C:\php\blah.pdf", "w");
fputs($fptr, $HTTP_RAW_POST_DATA);
fclose($fptr);
?>
However, when using this code.  The pdf submits correctly, but it opens a new pdf ...I think with the website inside the pdf.  Because there is no text on the website.  I cant really tell what it is doing.  However, when I try to close the pdf, I get several warnings about an open data connection and saving the results.  
Ideally I dont want those warnings.  It will only confuse people.

I wouldnt mind however, if the new pdf opened with the text submission successful and a button to close the file with no additional warnings.  I just want this to submit as easily as possible with minimum warnings.

Thanks
0
Comment
Question by:pattersonr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 22767701
I've never seen the warnings - but as I said before, I've also never used ASP or PHP.

When you submit a form, you want some confirmation that your form was successfully submitted - on the web, you would get a page that confirms that, with Acrobat, Adobe expects you to provide a PDF that would indicate that. You can actually just send a text response, and Acrobat will turn that into a PDF file.

Try to send something back, just so that you can see more than just a blank page. This may get rid of the warnings (or it may not...).
0
 
LVL 1

Author Comment

by:pattersonr
ID: 22767808
krkremer,

Good to have you back :)  Ok I was able to add some html as a title and that now shows up in the pdf document.  So now there is a single line that says Submission Successful.  When I try to close the new pdf.  I get a save yes/no prompt.  I dont suppose there is a way to stop that?
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 22767959
Only the full Adobe Acrobat application will prompt to save the file, Reader (because it cannot save the file) will just close it. As far as I know, there is no way to not show that dialog.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 22767975
[Was not really ready to submit yet]
... at least not when you have Acrobat create the PDF file for you. Try to provide a PDF file from the server. In this case, the document does not need to be converted by Acrobat, and you may not get the save dialog.
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 2000 total points
ID: 22768117
After a quick test, it turns out that I was wrong: Even with a PDF file, you still get the prompt. So, there is no way around that.
0
 
LVL 1

Author Comment

by:pattersonr
ID: 22931463
Ok thanks Kremer I appreciate all your help
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to count occurrences of each item in an array.
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question