Jump to content

Search the Community

Showing results for tags 'data uri scheme'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi Everyone, I am struggling with a pdf. On our server I get the pdf as a byte array from the database, which I then build up in a StreamingOutput object and return as a pdf file. This is done using java using JAX-RS service. Now when I open the path/link in my browser(chrome/firefox) the pdf opens in the browser. So this means my backend is working. On my webapp I want to use $.ajax to download the pdf and view it in an Iframe or embed it in an <embed> or <object> tag. I need to do this as the service call is actually under username and password, and we do not create a session between the browser and the server - there is a long explanation for this. I saw the option to use http://[username]:[password]@www.myserver.com/... but this was dropped by most browsers. This is why I am trying ajax. Now in my ajax call I do receive the pdf in the success function as: %PDF-1.4.... This open the browser's pdfviewer correctly and every thing, but the pdf only returns blank pages. The Base64 is a java object that I found on the internet. But I have tried it without the base64 but still now luck. Here is my success function from my ajax call. success: function(data, status, xhr) { var pdfText = Base64.encode(xhr.responseText); var url = "data:application/pdf;base64," + escape(pdfText); var html = '<embed width=100% height=600' + ' type="application/pdf"' + ' src="' + url + '">' + '</embed>'; $("div.inner").html(""); $("div.inner").append(html); }, Can anyone help me? Kind regards
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.