隨筆 - 0, 文章 - 2, 評論 - 1, 引用 - 0
          數(shù)據(jù)加載中……

          對JavaPrintService API的一個誤解

          使用JavaPrintService API打印HTML文檔失敗,原來是因為對JPS的誤解。雖然JPS中提供了DocFlavor.INPUT_STREAM.TEXT_HTML_HOST類型的DocFlavor,但根本沒有提供具體的實現(xiàn)HTML打印的功能。

          This is "not a bug". It is user misunderstanding of the API.

          Note that contrary to the indication of the submitter there is
          documentation on this API.

          See http://java.sun.com/j2se/1.4/docs/guide/jps/index.html

          We have already documented explanation of this aspect of the API in
          the user guide and in javadoc specification for the DocFlavor class.

          Eg in the user guide it says
          "..Before printing a document of a particular format, the client needs to ensure
          that the printer can understand the format..."

          The API allows you to ask to find all print services that print a particular
          document type. A document type is little more than a mime string.
          The only point in being able to ask the question is if there's more than
          one possible answer. If all print services could print all document types
          there'd be no need for such a query.

          You can ask for almost anything. For example I could ask for a PrintService
          that prints RTF or TIFF or anything. But for a print service to be able to
          do that requires a whole lot of code somewhere that understands that format.

          In merlin (1.4) there's no code anywhere in the printing implementation
          that can handle any HTML in any form at all.
          So when you ask for services that handle this, the answer is there are none.

          The only way this is going to work is with some additional software.
          A third party could write this and plug it in, (read the API docs for more
          background in what's involved there) but that's a large chunk of
          work and unlikely to be available any time soon.

          posted on 2005-03-10 11:17 笨蛋糕 閱讀(356) 評論(0)  編輯  收藏


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 富顺县| 左贡县| 镇赉县| 巴彦淖尔市| 山东| 酉阳| 新郑市| 浪卡子县| 桐城市| 阜康市| 北安市| 大埔县| 日土县| 平利县| 康平县| 崇义县| 济阳县| 云浮市| 广汉市| 衡东县| 合江县| 永春县| 长乐市| 四子王旗| 库伦旗| 永和县| 贡觉县| 通城县| 都安| 桂平市| 平和县| 台北市| 郴州市| 阿合奇县| 滕州市| 康定县| 三门县| 南江县| 枞阳县| 万年县| 丹棱县|