# How to print file from Processing, USB printer

**URL:** <https://discourse.processing.org/t/how-to-print-file-from-processing-usb-printer/44423>\
**Category:** Project Guidance\
**Created:** [May 14, 2024, 3:11am UTC](https://discourse.processing.org/t/how-to-print-file-from-processing-usb-printer/44423 "2024-05-14T03:11:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dada](https://avatars.discourse-cdn.com/v4/letter/d/9d8465/32.png) [@dada](https://discourse.processing.org/u/dada)\
**Post date:** [May 14, 2024, 3:11am UTC](https://discourse.processing.org/t/how-to-print-file-from-processing-usb-printer/44423/1 "2024-05-14T03:11:17Z")

</div>

Hi

I’m making my new project as student.  
it works vary simple process.  
1\_click the button that showed on screen, and 2\_print image from printer that connected with computer via usb.  
the image is pdf file. and i use my labtop window 10 and peripage A6 mini print.  
mini print’s working process is same with other printer, open file and click ctrl+P.

I read some information that said it could possible.  
but I can’t find sepecific code about print file from processing, so i need your help.

sorry my english is not perfect, I hope you understand.  
thank you!

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [May 14, 2024, 3:20pm UTC](https://discourse.processing.org/t/how-to-print-file-from-processing-usb-printer/44423/2 "2024-05-14T15:20:41Z")

</div>

As far as I am aware, there is no simple Processing call to send a document to a printer. It is likely that you will need java code for this. Look in java docs for documentation on Printable (it’s in java.awt.print).

Another technique uses DocFlavor found in javax.print. On macos _DocFlavor.INPUT\_STREAM.PDF_ seems to work ok. Could use _DocFlavor.INPUT\_STREAM.GIF_ if you have some other operating system and .PDF doesn’t work.
