Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functionality to return base64 #43

Open
Gobind03 opened this issue Sep 16, 2016 · 5 comments
Open

Add functionality to return base64 #43

Gobind03 opened this issue Sep 16, 2016 · 5 comments

Comments

@Gobind03
Copy link
Contributor

Gobind03 commented Sep 16, 2016

Please check the pull request - I have added another option for getting the base64 for the pdf also. set
render variable at the time of calling to 'base64' and the script would
return base64. Very handy if the pdf is being forwarded to a service
after generation by the developer! Can you please have a look at it ? Thank You :)

@Gobind03 Gobind03 changed the title Unable to Send Pull Request - Added Functionality to return base64 Please check the pull request for - Added Functionality to return base64 Sep 17, 2016
@Gobind03 Gobind03 changed the title Please check the pull request for - Added Functionality to return base64 Add functionality to return base64 Sep 17, 2016
@kbrown01
Copy link
Contributor

I merged the pull request but I am confused at what you think it does based on your description -- this code:

return utf8ToBase64(xepOnline.Formatter.entity_declaration + current_stylesheet + printcopy);

Would return the content in base64 encoding that is being sent to the server to be formatted, not the resulting PDF being returned after formatting. Your comment seems to indicate otherwise. I can see this being helpful in systems that may want a fully resolved chunk of HTML content.

If you wish to implement something that just stores the base64 encoded PDF that is the result of formatting, that would be easy as the system returns base64 encoded PDF in the Response XML which is already parsed out.

@kbrown01
Copy link
Contributor

If you look for this line ...
var base64 = jQuery(Response).find("Result").text();

you could set such a flag as you have done and if that flag is set, just return that value which would return the base64 encoded value of the result. Is that what you where trying to do?

@Gobind03
Copy link
Contributor Author

Yes I think I messed up, somehow my trial page returned the correct base64 ... I will change the render name for current commit and add a new render option for this
var base64 = jQuery(Response).find("Result").text();
thing. If thats okay ?

Also would you want me to change the read me file too ?

@kbrown01
Copy link
Contributor

I have several changes ... I just commented on one to see how people want it implemented. I will handle the readme as I will have a new option too.

@kbrown01
Copy link
Contributor

kbrown01 commented Sep 29, 2016

I have another one similar to yours that actually breaks the base64 and stores in the webbrowser. I will need to walk through all that to see what to do. That was a fork that allows people to do something like ... Download ... As PNG and they would get a downloaded PNG of every page in the PDF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants