Earlier quoted context omitted.
I am not at a computer noe, so I can’t test it, but do you take redirects into account? I hope you are not just whitelisting the initial URL, but also any URL’s it redirects to. If you don’t already, you should probably just disable redirects in whatever library you use.
I gave this a thought for a moment. Since we're using a real browser, there are huge amount of different ways to get the browser display a file:// link. Redirect is one, window.location.href is another, etc. The service shouldn't be run publicly in the internet for real use cases. If you do, the server should be designed in a way that it's not dangerous if the web server user gets read access to file system. I added…
URL to PDF Microservice
61–70 of 95 posts
Re: URL to PDF Microservice
#62I would like to adopt something like this, but there are some pretty normal table functions in our current print solution that I don't know how to support in HTML. E.g. on a multi-page invoice, show a sub-total row at the bottom of each page. Does anyone know how to create this kind of function?
The browser will display a different CSS to the printer, so to speak.
Re: URL to PDF Microservice
#63I would like to adopt something like this, but there are some pretty normal table functions in our current print solution that I don't know how to support in HTML. E.g. on a multi-page invoice, show a sub-total row at the bottom of each page. Does anyone know how to create this kind of function?
Re: URL to PDF Microservice
#64I would like to adopt something like this, but there are some pretty normal table functions in our current print solution that I don't know how to support in HTML. E.g. on a multi-page invoice, show a sub-total row at the bottom of each page. Does anyone know how to create this kind of function?
Re: URL to PDF Microservice
#65I would like to adopt something like this, but there are some pretty normal table functions in our current print solution that I don't know how to support in HTML. E.g. on a multi-page invoice, show a sub-total row at the bottom of each page. Does anyone know how to create this kind of function?
IIRC you can solve that using CSS for print media. The browser will display a different CSS to the printer, so to speak.
Re: URL to PDF Microservice
#66I am using PhantomJS for a similar project running on AWS Lambda - running into all sorts of rendering bugs / crashes. Wanted to make the switch to puppeteer, but as of now it requires a higher version of NodeJS than what Lambda supports. Was in the process of looking at Docker containers for my service, anyone have any thoughts on Heroku vs Docker?
https://service.prerender.cloud/screenshot/https://google.co...
Re: URL to PDF Microservice
#67Earlier quoted context omitted.
This is just pedantic. Anything can be scalable using that definition. Heck, I could hire a 3rd world worker to manually draw the PDF's, scan them to PDF using a scanner, and put them on a server and it would "scale linearly with the amount of money I spend" on labor.
Redrawing the PDF's and scanning them would likely not scale linearly with the amount of money you spend on labor. Labor tends to have diminishing marginal returns. The cost of hiring two workers is more than double that of hiring one worker because there is additional complexity in coordinating the workers. Also, for the record, this comment I'm making right now is just pedantic.
Round-robin those folks.
Re: URL to PDF Microservice
#68Earlier quoted context omitted.
I am not at a computer noe, so I can’t test it, but do you take redirects into account? I hope you are not just whitelisting the initial URL, but also any URL’s it redirects to. If you don’t already, you should probably just disable redirects in whatever library you use.
I gave this a thought for a moment. Since we're using a real browser, there are huge amount of different ways to get the browser display a file:// link. Redirect is one, window.location.href is another, etc. The service shouldn't be run publicly in the internet for real use cases. If you do, the server should be designed in a way that it's not dangerous if the web server user gets read access to file system. I added…
window.location.href = 'file:///' will return console error: "Not allowed to load local resource"
Re: URL to PDF Microservice
#69I am using PhantomJS for a similar project running on AWS Lambda - running into all sorts of rendering bugs / crashes. Wanted to make the switch to puppeteer, but as of now it requires a higher version of NodeJS than what Lambda supports. Was in the process of looking at Docker containers for my service, anyone have any thoughts on Heroku vs Docker?
Hey, I'd love to talk to you more about your issues with getting over to puppeteer. I'm working on a product that separates application infrastructure from Chrome as it's nightmare to try and scale with. I've written somewhat extensively about the deployment approaches here: https://hackernoon.com/more-than-you-want-to-know-about-head...