-
Notifications
You must be signed in to change notification settings - Fork 28
Feature: ability to serve a temporary static PDF #36
Comments
You are requesting the render service from front-end, right? What about making a flag for tweaking Hmm, actually that could be the new default, as it shouldn't affect anything other than browsers. So you could generate a regular link, which would download the PDF. Of course the latency depends on the complexity of the page, etc. I also have a longstanding task open to add an async API, but haven't gotten to it. Planned to have a postback URL, but that's no use in FE. |
Yes, I'm requesting the render service from the Express front end. Your change would make sense and certainly work for most use cases (as you say, makes sense as the default). By async, I assume you mean something like "send a request with a callback URL to POST to". That would work well in some cases as well. My use case is somewhat different however: I have minimal control over the AJAX client, so the response is always parsed as text. I can email you credentials for my test server if you want to have a look... or, I'm happy to accept that mine is an edge case 😄 |
I'm just wondering if you have an alternative way not to use AJAX client at all and just generate an link to a URL to download? |
Hey @msokk looks like you meant to post something above but didn't quite manage to! |
Fixed the quotation. You could send me the test access if it is still relevant and not a big bother. |
Hey @msokk , sorry, I completely forgot about this. I would still like to do this as I think it's a useful enhancement to the project. I'll email you credentials now. |
I'm making something within a Saleforce.com APEX page where I had to use their own AJAX client, where responses are always parsed as text, rather than giving me the option to parse the response as a blob, as I'd normally do with SuperAgent. As a result, I need
electron-render-service
to send back a temporary URL to the client where they can then perform a simple get to the resource.I'm working on a PR where the render service saves a file to
public/download-[timestamp].pdf
. It then returns the URL of the file to the client as JSON. Once the file has been accessed, it is deleted.I've got it working in the narrow use-case for my client, but I was thinking of turning it into a PR for the project. I've designed it so that there's anther query parameter
sendBinaryOrURL
which you can set tobinary
orurl
, defaulting tobinary
if you don't provide the parameter (replicating the current flow).Would you be interested in accepting a PR for this?
The text was updated successfully, but these errors were encountered: