Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8094382

[Printing] JavaFx & Cups problems

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 8
    • javafx
    • None

      Good day!

      Printed documents we create using WebView and send them to print. To correct formation of the document, we need to know the dimensions of the print. After getting a reference to the printer, we create PageLayout, while we need to get the minimum border width from different sides.

      Problems we encountered
      1) Under the Linux operating system incorrectly issued DPI. The printer is able to print with the DPI 102, 204. Under linux java gives DPI = 300

      2) When trying to obtain a minimum PageLayput border with code:
      PageLayout pl = prn.createPageLayout (pa.getDefaultPaper (), PageOrientation.PORTRAIT, Printer.MarginType.HARDWARE_MINIMUM);
      throws java.lang.reflect.InvocationTargetException
      Full stack is available in Google drive(file hardware_minimum_stack.txt).
      This problem occurs on Windows also

      3) When creating PageLayout:
      PageLayout pl = prn.createPageLayout(pa.getDefaultPaper(), PageOrientation.PORTRAIT, 6,6,6,6);
      On Linux will still be shown that the size of a border 54

      Example (TestPrinting.java, line 55)
      info(" Printable size: "+pl.getPrintableWidth()+"x"+pl.getPrintableHeight()+", border: "+pl.getLeftMargin()+","+pl.getTopMargin()+","+pl.getRightMargin()+","+pl.getBottomMargin());

      Linux:
          Printable size: 390.0x599.0, border: 54.0,54.0,54.0,54.0
      Windows
          Printable size: 627.0x3364.39370727539, border: 6.0,6.0,6.0,1397.6062927246098

      I would like to understand what it depends


      3) Issued incorrect paper size
      We used to print roll. Accordingly, we need to use size "80*ROLL". Windows operating system this size is read correctly, and even under Linux there is nothing like

      Output of the test program:
      Windows:
      INFO Printer: CUSTOM VKP80 II
      13:30:09,522 INFO Default page layout: Paper=Paper: VKP80 II Roll size=225.49575805664062x1682.1529541015625 MM Orient=PORTRAIT leftMargin=54.0 rightMargin=54.0 topMargin=54.0 bottomMargin=1397.6062927246098
      13:30:09,522 INFO Default copies: 1
      13:30:09,523 INFO Default paper: Paper: VKP80 II Roll size=225.49575805664062x1682.1529541015625 MM
      13:30:09,523 INFO Supported papers:
      13:30:09,523 INFO Paper: VKP80 II 120mm size=225.49575805664062x350.99151611328125 MM
      13:30:09,523 INFO Paper: VKP80 II 160mm size=225.49575805664062x469.6883850097656 MM
      13:30:09,523 INFO Paper: VKP80 II 200mm size=225.49575805664062x586.4022827148438 MM
      13:30:09,523 INFO Paper: VKP80 II 240mm size=225.49575805664062x702.8328857421875 MM
      13:30:09,523 INFO Paper: VKP80 II 280mm size=225.49575805664062x820.1133422851562 MM
      13:30:09,523 INFO Paper: VKP80 II 400mm size=225.49575805664062x1171.9547119140625 MM
      13:30:09,523 INFO Paper: VKP80 II 80mm size=225.49575805664062x232.86119079589844 MM
      13:30:09,523 INFO Paper: VKP80 II PTP size=211.61473083496094x1133.14453125 MM
      13:30:09,523 INFO Paper: VKP80 II Roll size=225.49575805664062x1682.1529541015625 MM
      13:30:09,523 INFO Paper: VKP80 II Roll Short size=225.49575805664062x1545.3258056640625 MM
      13:30:09,524 INFO Default print resolution: Feed res=200dpi. Cross Feed res=204dpi.
      13:30:09,524 INFO Supported resolutions:
      13:30:09,524 INFO Feed res=100dpi. Cross Feed res=102dpi.
      13:30:09,524 INFO Feed res=200dpi. Cross Feed res=204dpi.
      13:30:09,524 INFO Default print quality: NORMAL
      13:30:09,525 INFO Default print sides: ONE_SIDED
      13:30:09,525 INFO Default collation: COLLATED
      13:30:09,525 INFO ----------------------------
      13:30:09,525 INFO Printable size: 627.0x3364.39370727539, border: 6.0,6.0,6.0,1397.6062927246098
      13:30:09,525 INFO Paper size: 639.0x4768.0


      Linux:
      2:43:56,295 INFO Printer: CUSTOM_Engineering_VKP80
      12:43:56,296 INFO Default page layout: Paper=Paper: iso-b8 size=175.63739013671875x249.29177856445312 MM Orient=PORTRAIT leftMargin=54.0 rightMargin=54.0 topMargin=54.0 bottom
      Margin=54.0
      12:43:56,296 INFO Default copies: 1
      12:43:56,297 INFO Default paper: Paper: iso-b8 size=175.63739013671875x249.29177856445312 MM
      12:43:56,297 INFO Supported papers:
      12:43:56,305 INFO Paper: 80mm * 160mm size=214.86402893066406x452.7138671875 MM
      12:43:56,305 INFO Paper: 80mm * 200mm size=214.86402893066406x565.64306640625 MM
      12:43:56,305 INFO Paper: Letter size=8.5x11.0 INCH
      12:43:56,305 INFO Paper: iso-b0 size=2832.861083984375x4005.665771484375 MM
      12:43:56,305 INFO Paper: iso-b7 size=249.29177856445312x354.1076354980469 MM
      12:43:56,305 INFO Paper: iso-b8 size=175.63739013671875x249.29177856445312 MM
      12:43:56,306 INFO Default print resolution: Feed res=300dpi. Cross Feed res=300dpi.
      12:43:56,306 INFO Supported resolutions:
      12:43:56,307 INFO Feed res=300dpi. Cross Feed res=300dpi.
      12:43:56,308 INFO Default print quality: NORMAL
      12:43:56,309 INFO Default print sides: ONE_SIDED
      12:43:56,310 INFO Default collation: UNCOLLATED
      12:43:56,310 INFO ----------------------------
      12:43:56,310 INFO Printable size: 390.0x599.0, border: 54.0,54.0,54.0,54.0
      12:43:56,310 INFO Paper size: 498.0x707.0


      Project, printer driver, ppd and cups admin screenshot:
      https://drive.google.com/folderview?id=0Bz7309sTKJ2nWFJpc0Z2RXF5aEU&usp=sharing

            prr Philip Race
            valexandejfx Vorobyev Alexander (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: