tojocky / node-printer

Native node.js printer
1.53k stars 440 forks source link

Can you put an example of printing content different from RAW? (Pdf, Png, Odt,...) #8

Open q2dg opened 10 years ago

q2dg commented 10 years ago

Thanks!!

tojocky commented 10 years ago

I don't have time for now... but feel free to propose examples.

q2dg commented 10 years ago

Ok, I will investigate

q2dg commented 9 years ago

Hello.

Trying to print a pdf document simply specifying PDF type has a correct behaviour

Trying to print a jpg photo specifying JPEG type gives a completely distorted image because printer prints the image scaled to the full size of paper. The same occurs if I use JPEG type to print a png photo: it works (!?) but with the same size issue. So, how could the printed size of a photo be controlled from my program?

Unfortunately, I've not been able to print a odt document: with AUTO type printer gives several pages of strange symbols and (only for testing) with PDF or JPEG type my computer gives a system error.

So...apart from text and pdf (and,maybe, jpg/png) data , it seems it isn't possible to print in other formats in a simple manner

My system is Node v0.11, Fedora 20 64 bits.

Thanks a lot

tojocky commented 9 years ago

You missed TEXT format ;-) Did you check http://www.cups.org/documentation.php/api-cups.html ? I will try to look once I have time. interesting post: http://www.cups.org/pipermail/cups/2012-September/025333.html

q2dg commented 9 years ago

Thanks for your answer.

You're right, I missed it. But trying to print an odt (whose content is a sentence and a image) with TEXT format prints some weird characters.

...and thanks (again) for the links, but my programming skills are very limited...sorry. I only can be a tester for now. Interesting post too is http://marc.info/?l=cups&m=118607366816904&w=1

ezmac commented 9 years ago

q2dg, I think cups has to understand the format and odt is not understood. For word docs, I'm using doc2pdf to do the conversion before printing.

q2dg commented 9 years ago

Well...there is http://www.cups-pdf.de too, but...

praveen-tripathi commented 7 years ago

Is there any way to print html fomat?