c# - Showing PDF in PopUp -


i using asp.net mvc , want show pdf in jquery dialog or inside boostrap modal popup.

i tried ajax call if controller action returning file return file(....) giving wrong output in popup.

if use iframe when specifying url inside iframe redirecting httpget controller action want redirect httppost controller action(because have post form also).

actually why want open pdf inside popup or iframe because right pdf opening in same window want open in new browser tab or inside popup or inside iframe visitor continue use website without pressing browser button.

i stuck this..plz help..!!!!

you can use request iframe , right way it. if create pdf post request need return kind of file id or file name. , in iframe file using id or file name.

  1. post request creating pdf returns id or filename
  2. get request /path/to/your/pdf_files/<filename>.pdf in iframe.

update:

if want display small files (this method not recommended big files) come previous post request without saving them anywhere use data url:

  <iframe type="application/pdf"         width="95%"         height="95%"         src="data:application/pdf;base64,<base64_encoded_pdf_file_string_here>">   </iframe> 

just replace <base64_encoded_pdf_file_string_here> actual base64 string representation of file.

in order base64 string of stream make use of convert.tobase64string method.


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -