Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9163653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:29:51+00:00 2026-06-17T14:29:51+00:00

What is the easiest way to print dynamically generated HTML through a Java Print

  • 0

What is the easiest way to print dynamically generated HTML through a Java Print Server? Due to restrictions on the project I have to send the HTML string to the printer. I cannot do any file I/O to write to an HTML file and then send the reader to the Print Server. I am also unable to send the data to a JSP and then print the JSP.

In all of my searches online I have found several examples of how to print text from an input reader, but never from a String. What would be the best approach to take?

I have tried looking up plain text and html text doc flavored print services but none of my printers are being returned:

DocFlavor flavor = DocFlavor.STRING.TEXT_PLAIN;
DocFlavor flavor = DocFlavor.STRING.TEXT_HTML;

P.S. Part of the reason for the requirements is a web-based application needs to print to various types of printers without the print dialog popping up. Any machine that will be running this web app will be set up by us so any settings/permission issues are not a problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:29:52+00:00Added an answer on June 17, 2026 at 2:29 pm

    What about converting the String to an InputStream?

    InputStream stream = new ByteArrayInputStream(exampleString.getBytes(“UTF-8”));

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a string ABCD What's the easiest way I can define a
What is the easiest way to print out something in a Tomcat Log file.
What's the easiest way to search a div for a text string using jquery?
What would be the easiest way to update a HTML tag with the following
What's the easiest way to print multiple cfreport in a single print job? The
What's the easiest way to create drop shadows around div boxes? A print media
What is the easiest way to print all a list's elements separated by line
I have a simple button in HTML like this: <input type='button' id='btnPrint' value='Print' onclick=changeStylesheet();
With C++/C, the easiest way of debugging is to use cout/printf to print out
The hex string '\xd3' can also be represented as: Ó . The easiest way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.