How to print a PDF created with iText?

前端 未结 1 1119
面向向阳花
面向向阳花 2021-01-21 09:20

Hi I have created a PDF file with an image in it, I want to print my pdf after creating. Better if I have the PDF in memory instead of having a file, and then send it to the pri

相关标签:
1条回答
  • 2021-01-21 10:07

    You can always use a ByteArrayOutputStream instead of a FileOutputStream.

    After you have the PDF bytes, its a normal "how do you print in Java" question. Many printers (or at least their drivers) will take PDF directly these days, so at that point one could argue that you're done.

    PS: Once I tagged your question "Java" it colored your code block using "import" as a keyword and so forth. Something to keep in mind in the future.

    0 讨论(0)
提交回复
热议问题