I am using PhoneGap / Steroids for an iOS app.
In PhoneGap, I request a pdf from the server. The pdf is received in base64 format.
I am able to successfully preview the pdf using InAppBrowser:
window.open( "data:application/pdf;base64," + pdf.data, "_blank" );
However what I really need is to send this pdf data to the printer via AirPrint. Is it possible to do this using InAppBrowser? If not, what is the recommended method?
Thanks (in advance) for your help
Well, I don't think there is any use for InAppBrowser for this purpose. What you should look instead is for plugin that connects to AirPrint such as Cordova Print Plugin. This allows you to connect to AirPrint from within your JavaScript code. I'm not sure about if it fits all of your purposes, though, but take a look.
Related
So, I have this application in Symfony, I use a printer for some stickers, which is fine using JS window.print(), but now, I need to print PDFs and I cannot ask the user to do anything.
Is it possible to directly send the PDF to the printer either from PHP or JS?
I can setup a local server which will be connected on the same network with the printer.
I cannot find nothing about directly printing except some PHP 4.0.4 version extension.
I'm using Symfony 4 with PHP 7.3 and JS for the front end stuff.
Can you please advise if there is a library for PHP or I can skip the print button on window.print() in JS.
Thanks in advance
Directly this shouldn´t be possible, but what if your Printer has got a smb-hotfolder functionality? Then you could write out files into this hotfolder. Regards
I´m making a simple webapp, I want that when it is open in mobile phones print some data using the user´s wifi printer which most of cases will be an Epson L355.
Can anybody give me a clue or sample to achieve this?
Thank you all.
You won't be able to do this because you don't have access to the user's printer. Instead, you can just generate a pdf and redirect user on it.
The user will then be able to download / print the pdf via his inline PDF viewer.
You can do it by following this :
How to force files to open in browser instead of download (pdf)?
On click of a button, without doing a round trip to the server, can we save a HTML5 page on clients machine as PDF.
Check out PDF.js. This lib can create pdf in the browser (or serverside on node.js).
Using chrome you can print the page to a pdf file.
You need something like this, maybe server-side you can start a browser and print the content to a pdf file and send this to the client.
Disclaimer: i work for ByteScout
If you have simple HTML formatting and want to generate PDF on client side and if you have non-commercial project, check BytescoutPDF.js - it supports simple HTML formatting for text (font name, size, color) plus simple drawings and images, should be enough for simple reports
I want to develop a web office project just like Google Docs and ExtJS seems good. Can ExtJS read OOXML or ODF natively? Or is there any open source project which can help ExtJS decode OOXML or ODF files and edit them?
Many Thanks!
ExtJS is a client side javascript framework. It cannot read any files be it OOXML,ODF or PDF. Are you trying to display a file or download it? there is no file handling involved with ExtJS.
try to look at odf javascript framework: http://webodf.org/demo/
You'll need to read the file with a server side script using something like PHP. Then pass this to the client side using AJAX.
ExtJS has the AjaxRequest method which you can use to get data from the server. Then pass the response text to the value property of the element you're using to display the file.
Going to be working on something similar myself soon.
If all you want to do is preview the google doc in your client side application, grab the preview url of the doc (every doc should have one) then display that document in an iframe in your extjs application.
I have an app that generates PDFs and I want it to be able to print the PDF to the client default printer. How can I accomplish that?
Thanks
Edit: Javascript link could also work.
You could embed javascript in your pdf.
http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/Acro6JSGuide.pdf
So when you generate the PDF, use this.print() when the document is opened.
Rails only sends the PDF to the browser, and the browser/user handles printing. You really can't control what printer it gets sent to...