Comments (6)
If you're using the download output class, it's already implemented like you suggested: https://github.com/spiritix/php-chrome-html2pdf/blob/master/src/Spiritix/Html2Pdf/Output/DownloadOutput.php#L52
from php-chrome-html2pdf.
Yes I am aware of that but the problem is, when using that one, the file is downloaded automatically.
We want it to display inline, but when the user wants to download it, it gets downloaded as a PDF.
from php-chrome-html2pdf.
Now when the user wants to download it the Chrome browser says it's downloading index.php instead of the PDF
from php-chrome-html2pdf.
Okay I see. The issue is that the RFC states:
If the disposition type matches "attachment" (case-insensitively), this indicates that the recipient should prompt the user to save the response locally
I don't see a way to use 'attachment' and still embed the file in the browser. Do you have an idea how to do that?
from php-chrome-html2pdf.
I think we need to look for a way to be able to use "inline" and somehow get the filename download to work correctly.
The strange thing is we get different results on Chrome on different environments (server vs locally on vagrant) and wether it is the result of a POST request vs a call without using POST.
I'll investigate more and when I have some clear results we can check the solution
from php-chrome-html2pdf.
I think the browser automatically uses the file name as in the URL. So in case of www.example.com/pdf.php it will be pdf.php. You could use rewrite rules to redirect a filename like /MyFile.pdf?id=1000 to /pdf.php?id=1000, that should work.
Leaving this issue open in case anybody has an idea on how to solve this in the backend.
from php-chrome-html2pdf.
Related Issues (20)
- custom css for header/footer HOT 1
- style markup issues in combination with <table> HOT 5
- Problem with page.waitFor HOT 1
- Headers displayed in PDF HOT 1
- Unable to install on Linux Server HOT 1
- Uncaught PHP Exception: Shell error: 133 HOT 4
- Shell error 127 on linux ECS aws server but works fine on local HOT 5
- Binary error HOT 1
- Failed to launch the browser process HOT 1
- Cookies are not sent to Server while fetching content of the URL HOT 1
- No images/css/assets on relative urls HOT 3
- CSS Issue unexpected identifier "font"
- Fatal error: Uncaught Spiritix\Html2Pdf\ConverterException: Binary error: # # Fatal error in , line 0
- [Upgrade] Replace eloquent/composer-npm-bridge by php-forge/foxy HOT 1
- Binary Error -> import getStdin from 'get-stdin'; ^^^^^^^^ SyntaxError: Unexpected identifier at Module._compile HOT 5
- Binary error: Puppeteer old Headless deprecation warning HOT 3
- pageNumber and totalPages are not displayed in footerTemplate HOT 3
- Feature request: Add Auto Height
- urls with "file://" get a "net::ERR_UNKNOWN_URL_SCHEME " error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-chrome-html2pdf.