How to print correctly JavaFX WebView?

How to print the content of the Web view in JavaFX?

By that, I mean taking into account the rules @page CSS and page break properties.

I know a solution posted here printing in general with JavaFX: https://blogs.oracle.com/rakeshmenonp/entry/javafx_printing,.
but I can't do consider printing the CSS rules for paged media, although the underlying WebKit platform should have no problem interpreting them.

Published by: 889232 on June 25, 2012 02:31

JavaFX has no print media.

Consult the following feature requests:
Support CSS @media print http://JavaFX-JIRA.Kenai.com/browse/RT-17289
Webview and HTMLEditor http://JavaFX-JIRA.Kenai.com/browse/RT-17666 should support print their content
http://JavaFX-JIRA.Kenai.com/browse/RT-17383 Printing

------------------
Workarounds

You can take a snapshot of a node to an image in the buffer by using the awt robot and print that.
Or you can use 2.2 and take a snapshot of a node on or off the screen to an image of JavaFX, that convert an image in the buffer and print (although this method had still some problems with the current generation of developer 2.2b13 when I tried it).

Example program for the 2.2 JavaFX api snapshot is here: LineChart in PDF with IText (it can be adapted for WebView).

Use the HostServices.showDocument api to display the HTML in a browser to system and create a user print from that.
http://docs.Oracle.com/JavaFX/2/API/JavaFX/application/HostServices.html#showDocument%28Java.lang.String%29

Tags: Java

Similar Questions

  • 4.0 beta 12 do not print correctly. Is there a solution? How do we uninstall Beta 12?

    After installing the latest patch, nothing will print properly. All the sites, all the files, just not spacing correctly when sending to the printer. Previous version worked end and all other browsers print correctly.

    The fix will be in the next beta version, if there is one, or in the version 4.0 Release Candidate. Or you can install the last mine field every night.

    FTP://FTP.Mozilla.org/pub/Firefox/nightly/latest-Mozilla-Central/

  • When the scaling in the layout, 1st page prints correctly, but the following pages were not properly/too large for the paper, parts of text missing scale

    When you try to print in Firefox and when the scale to the size of the page in the page layout, the first page prints correctly, but the following pages do not scale correctly and are too large for the paper, with the parts of the text are cut off at top and right. It is not fixed by checking or unchecking the scaling / shrink to fit page width "ignore" in the print window, or by changing the scale percent.

    I am running Firefox 15.0.1, on Mac OS 10.5.8.

    The same problem happens in preview print and if I save the copy in a .pdf file

    I tried all the fixes in the how to and others in various forums with no improvement.

    This happens everytime I try to print a document from scaling upwards or downwards in Firefox.

    I note the bug has been fixed and should in Firefox 21 right now, it will mean the use night http://nightly.mozilla.org/

  • How to print documents on my Samsung Galaxy 4 Note to my wish 7640.

    I installed the application all-in-one printer for my desire 7640 on my new cell phone running Lollipop (Android 5.0.1). I access my router wireless from my phone. The application sees my printer and reports the status of the printer correctly. However, I can't understand how to print a document (PDF or text) of my phone. Is it possible, or is it not even correctly works on pacifier? My phone is brand new and improved lollipop in the first round on. I just bought my printer a few days ago.

    Hello

    They are (printer and Samsung) on the SAME network? If so, please

    (a) the app, touch

    (b) the print/share button,

    (c) press Documents.

    (d) select the document on the list to print and the lauch

    e press Options (upper-right) and select print.

    Kind regards.

  • How to print in contact without name, only the name and address?

    How to print the list in contact without name, only name and address? Please

    Not enough info...

    Tell us a story

    -with a beginning, middle and end. We need to figure out what you know and that you have lived.

    If this problem is new, tell us what immediately preceded its appearance - add software, upgrade or update? New equipment?

    Quoted by of Apple  'how to write a good question.

    To help other members in answering your question, give as much detail as possible.

    • Include your product name and specifications such as processor speed, memory and storage capacity. Please do not include your serial number, IMEI, MEID or any other personal information.
    • Provide version numbers of your operating system and the relevant applications, for example "iOS 6.0.3" or "iPhoto 9.1.2.
    • Describe the problem and include details on what seems to make it.
    • The list of troubleshooting steps you have already tried, or temporary corrections that you discovered.

    For a detailed 'coaching', please see the advanced user > "Help us help you on these forums"https://discussions.apple.com/docs/DOC-5431>

    "Keep it short and Simple"-take your time... but be thorough - CCC

  • M252dw - how to print on a sheet of 4 x 6?

    How to print on a sheet of 4 x 6. I put a card in the main tray, but it printed the first line, low and complained of unexpected size.

    When I feed a sheet in the sheet, charger it just jams.

    There must be a setting in the menu that I can't find, or something.

    Thank you

    Hi @JonJacobs,

    Welcome to the Forums of HP Support! I see that you have problems printing on 4 x 6 index cards. I would like to help you today. If this helps you to find a solution, please click on the button "Accept as Solution" down below in this message. If you want to say thanks for my effort to help, click on the 'Thumbs Up' to give me a Kudos.

    Make sure the printer driver is correctly selected for the media size, the type of paper and the plateau. You can find more information of the printer on page 40, manuals, of Laserjet M252dw. You will also find documentation on loading trays.

    When you print from the main tray, remove the paper and simply load the paper 4 x 6.

    What operating system do you use?

    Mac OS X: how to find which Mac OS X Version is on my computer?

    How to find the Windows Edition and the Version on your computer.

    What applications do you use?

    Please let me know the results and if there is anything else I can help you. Thank you.

  • My computer does not recognize my new printer correctly

    Well, it's on me.  I got a new printer for the College, a HP Photosmart C4680.  After you run Setup of the printer, I plugged the USB cable on my computer before actually running the pilot, and now my computer refuses to recognize the printer correctly.  I tried to uninstall the driver, restart the computer and the printer, and nothing seems to work.  Is it possible that I can fix or do I definitely made my totally useless printer?

    Hello

    USB cable may be questioned... but one thing... Try your printer with another system and see how it works...

    post the result...

  • Office Jet 6000: cannot find how to print the test page with Office jet 6000

    I can't find in the properties of this printer HOW to print a test page. I was running out of ink black, and all color cartridges are rather recent and not on show at low levels. But, after replacing the black cartridge the first doc to test printed came out very uneven and unreadable.  There is no error message.  How in diagnostics on this printer to test the printing?  I tried not to print a doc of color (as photo) yet.

    Can I update the driver?  Help, please.

    Hello

    Test print page options under properties of the print driver for your device.

    But I don't think that solv your problem.

    You must print alignment and another test for correct print quality problems.

    Here is the HP site, gives detailed instructions form document.

    http://support.HP.com/us-en/product/HP-OfficeJet-6000-Printer-series---E6/3866939/model/3866950/document/c01708575/

    Good impression

  • How to print on printer 6520 envwelope

    need to know how to print envelope on HP Photsmart6520 thanks #10

    Hello Turkey1940,

    Welcome to the Forums of HP Support! I see that you are interested in printing envelopes on your HP Photosmart 6520 #10.  I would like that you start here: loading plain paper, Photo paper and envelopes

    Now that you have the envelope loaded, you must select the correct print settings, take a look below:

    1. open the document to print.

    2. on the file menu, click on print.

    3. click on Setup, properties, or preferences.

    NOTE: the specific options may vary depending on the software.

    4. click on the features tab.

    5. in the Basic Options pane, select other items from the paper size drop-down menu list.

    6. Select the correct envelope size (#10) and then click OK.

    7. in the Basic Options pane, select more in the paper type drop-down list.

    8. select Plain Paper and then click OK.

    9 change the other required print settings and then click OK.

    10. click OK to print.

    I hope this has been helpful, I'll leave you with your User Guide for later use.

    I've found this useful information here: loading and printing on envelopes in Windows

    Thank you

  • HP 8610: x 64 do not print correctly cut

    I snipped an element (using the Windows snipping tool) and pasted into a Word document.  When I view the document in the document print preview mode is correct.  When it prints the HP 8610 printed changes the size of the item snipped.  I tried to print the document using my old Pro from HP 8000 and it prints correctly snipped the element size.  However my 8000 old Pro does not print in color so I can't use it for this document.

    This isn't the first time the 8610 has changed the size of an item, snipped.  How can I solve the problem?

    Hi @socalobie,

    Welcome to the Forums of HP Support!

    I see you are having problems printing to a chiseled image correctly to your HP Officejet Pro 8616 e-all-in-one printer. I'd be happy to help you with this.

    In order for me to help you best, I can get more information.

    What format you save the image under?

    What program are you printing from?

    I recommend the following steps:

    Start with the capture of the image that you want to print, select Save Snip or click on the file-> record under-> Select the JPEG file-> save.

    Now, locate the image that you saved and double-click it to open it.

    It should open in Windows Photo Viewer.

    Choose Print-> Print-> choose your printer-> choose the right size of paper-> photo select to adjust the framework.

    See how that turns out.

    If you still experience problems, it could be a problem with the printer driver.

    Printing and scanning doctor will determine if the printer uses the correct driver. Please download and run the print and Scan doctor, it will be probably diagnose and fix the problem you are experiencing.

    What were the results when you ran the Print and Scan Doctor? (she print or scan, error messages)

    Please reply to this message with the result of your troubleshooting. I can't wait to hear strings attached good luck!

  • D110A printer not print correctly. Printer says "printing" but only a few characters on the homepage

    D110A printer not print correctly. Printer says "printing" but only a few characters on the homepage

    Hi amjo_2005,

    How the printer is connected to the device?

    What device you are trying to print from?

    What program you are trying to print from?

  • HP Photosmart 5510e printer has suddenly stopped printing correctly

    Original title: fault printer

    Hello

    I have a HP Photosmart 5510e printer that has suddenly stopped printing correctly because the black ink is not getting through.  I did everything possible troubleshooting I can and replaced all the cartridges for new ones, but nothing helped.  When I did a report print quality he had no black ink on it at all. This leads me to think that there may be a blockage between the cartridge and print head. Any ideas?

    You might want to try this: failure of black ink Photosmart 5510 e-All in one series

    Using cartridges HP no also could cause this kind of problem.  Otherwise, it is usually a sign that the printhead is kaput, impossible to replace this printer print head if the printer is also kaput, on the garbage heap, it will!  That's how it is with printers, you can either pay in advance for a printer expensive hard and has lower cost of Ink/toner replacement or you can buy a cheap and pay through the nose for ink replacement and in a year or two to mix the printer all out with the trash.

    John

  • HP Officejet 6000 printest test page, but do not print anything else. How to print wireless?

    I reinstalled the printer.  It printed the page test perfectly, now I will not print anything else.  How to print again?

    Hello

    Welcome to the Windows 7 community!

    From your problem description, I understand that you can not print from HP Officejet 6000. I take this opportunity to help you.

    Let us perform the following troubleshooting methods and check that it helps to resolve the issue.

    Method 1: Run the printer Troubleshooter
    first of all, make sure that your printer is turned on and connected to your Windows computer according to the manufacturer's instructions. Then, try the printer troubleshooter, which will attempt to diagnose and solve your problem automatically.
    For more information, see the article below:
    http://Windows.Microsoft.com/en-us/Windows7/open-the-printer-Troubleshooter

    Method 2: Restart the Print Spooler Service
    You must be logged on as administrator to perform these steps.
    a. open administrative tools by clicking the Start button, then Control Panel. In the search box, type administrative tools, and then click Administrative Tools.
    b. double-click on Services. If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.
    c. right-click on the print spooler service and then click Properties.
    d. on the general tab, next to startup type, make sure that automatic is selected.
    e. If the service is not already running, under Service status, click Start and then click OK. If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.

    Method 3: Configure the driver to correct the printer port
    on the tab "Ports" of the "Printer properties" window, select the port for the printer driver.
    a. from the Windows desktop, open the printer properties window.
    b. click the Ports tab.
    c. under "printing on the following ports; Select the port to which your printer is connected.
    Example: In this example, the printer is connected to the "USB001 virtual printer Port.
    d. click on 'Apply' to validate the changes.

    Click on general tab and then click on 'Print Page of Test' to confirm that the changes fixed the problem.

    You can also check out the links for more information.

    Printer problems in Windows: http://windows.microsoft.com/en-US/windows/help/printer-problems-in-windows

    For any further assistance, I suggest you to contact HP printer Support.

    Here is the link: http://www8.hp.com/us/en/support-drivers.html

    It will be useful. For any other corresponding Windows help, do not hesitate to contact us and we will be happy to help you.

    Kind regards!

  • How to print effects gradients in Illustrator CS5?

    I created several pieces for a project in Illustrator and now I want to send files to the customer for printing. My files are currently defined for the RGB color mode, and I have a gradient and a few effects (specifically some textures) added to different files. I noticed that when I changed the colors to CMYK (for printing purposes) mode the effects & gradients were gone and I read that they only work in RGB. So my question is how do I keep the gradients and effects intact so that I can print them? Don't they have to be in CMYK mode to print correctly? I thought maybe flattening or convert objects some how. I don't know what to do I am at a loss. Oh the customer wants the files in jpg format too. If you could tell me also how configure the file for printing would be great. I'm still new next to the printer of the things.

    Thanks in advance for the help.

    Open the file .ai with Photoshop. Convert to CMYK, save as jpg (do not use save for web).

  • Firefox 34.0.5 cannot print correctly. I checked all the pages on firefox problems and still can not solve the problem.

    I use 34.0.5 with Windows 7 and that you cannot print correctly. In print preview, it appears in a label size. I double checked all my settings in firefox and my preferences from the printer, I checked all the pages on firefox problems and still can not solve the problem.

    I was able to finally solve the problem, but I had to do a complete reset of firefox. Thank you for your time.

Maybe you are looking for