0 Replies - 45 Views - Last Post: 04 May 2015 - 09:36 AM

#1 notice88  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 91
  • Joined: 21-December 11

How to generate pdf stream, or send post data to pdf url?

Posted 04 May 2015 - 09:36 AM

Hi,

I 'am trying to generate pdf in a div tag like this.

<div id="pdf">
  <object width="400" height="500" type="application/pdf" data="pdftext.pdf" id="pdf_content">
    
  </object>
</div>



I am still unable to accomplish this due to my requirements.

-request using GET values must not be used.
-IFrame must not be used.
-no physical file is generated. Only strings.

I tried rendering base64 pdf byte stream using html 5 object but still no luck.

<div id = 'pdfHere'>
<object src="data:application/pdf;base64,JVBERi0xLjQKJeLjz9MKNSAwIG9iago8PC9GaWx0ZXIvRmxhdGVEZWNvZGUvTGVuZ3RoIDIzNzU+PnN0cmVhbQp4nL1cXXPauAJ951fo7XZnKGtJNrb3KUmzTT82bTZhOrNz9z4oWIBbY+faZjvkX/cfrCQISQAdUyNnyhCnsX2ODjo6+jL/752NenxIIm9IRknv91Hvzx4jH/T/UuKpf/o98hkZzXu/vqWEemQ06b36ZfRVn/t4ikfG86cXhYxElA/CcHUhI9TXF3rmz+W09+qvIk8W5O9XIzme5UVWTJfkUiSSvFvMRf73LxrAI9M9IP/9n/qZGJIAXr3ieANPyfA5eljPyNusKEpyJfKiFHNBzhZplqT5lHBf/fGmLqWsybgoc1mSP0QuyWmfnBV5OhHjtCAXWXErMvImrZckX2RZ/4HwMwZswIxyj8BXIhO5qPrkapZm6d1dmsuKUEq5gwJHzF5gzmhAmX4ZuubNAWTo2SE3OIeD2XHbXPOEa+CpjyImYRBu+PJtvueiluRCqs9bHSTkN1Ufl8TvE+bRoI1USpqAxT7Z/qmwlIvCwCNxQF7TgJSyN3lKlrMBj0jI4wHjD9pGz7n+Pr/LiqWU5FMxsHOj5Lv6y4f1ddcXD2TjQWDw1RlesD7OejfW81d01Ylzc8h9dYjON/fnweP9OT5fnfUEIHiC0FLdVZHi4V55KeMD3z9UXzGXPy8w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BbPDI3YmUwODczMzI5MGQzMTcwMDAzNzUzZmJmNDcwODJiPjw4ZjExZjkwNTJjMTJhZjgzNGM4OWFiOTFmZDU4OGRkYT5dL1Jvb3QgMTAgMCBSL1NpemUgMTI+PgpzdGFydHhyZWYKMzQ0MwolJUVPRgo" type="application/pdf" width="100%" class="internal">
        <param name="view" value="fitH" />            
    </object>

</div>



I have tried using plugins like pdf.js or pdfObject but this plugins won't allow me to pass POST values to the url(as far as I know).

PHP accomplished my task by doing this.
I use header('Content-type: application/pdf') and rendered string like this %PDF-1.4 % 5 0 obj <>stream x\r۶}W3 but they wanted it inside a div tag(not iframe).

Is there any way javascript can render byte stream or plugins which i can post values to URL and render the return and put it inside a div or generate an html5 pdf object?

Thanks in advance!

Is This A Good Question/Topic? 0
  • +

Page 1 of 1