Printing a HTML doc from a JEditor Pane

I would like to print a HTML page from a JEditorPane. I've searched trhough the web, but haven't found any free libs yet... Does anybody have some tips?

See
JEditorPane.setPage(URL)
once you've done that and its rendered you should be able to print by using my StandardPrint class. Search for StandardPrint.java on this site

Similar Messages

  • How to know size of HTML page set to Jeditor pane  for printing

    Hi,
    i have to print an HTML doc which may be more no of pages .... ,that is set to jeditorpane and this component will be sent to print method , there i have to decide whether page exists. To do so i have to know how many pages the html doc occupies . how can i know ??
    thanks in advance .......

    Hi,
    i have to print an HTML doc which may be more no of pages .... ,that is set to jeditorpane and this component will be sent to print method , there i have to decide whether page exists. To do so i have to know how many pages the html doc occupies . how can i know ??
    thanks in advance .......

  • Selecting html source from the text pane

    Help!!
    I am selecting text in the HTMLEditor text pane but when I look at the selected text it does not include tags like image and table tags. I would like to somehow grab the selected html source based on what is selected in the text pane. Is there a way to map the selected text in the editor textpane to the html in the editor sourcepane? I have not been able to find an answer in previous threads.
    thanks,
    Steve

    here is the easiest way i know
    using JEditorPane from the swing package
    JEditorPane sourceViewer = new JEditorPane(http://www.google.com);
    System.out.println(sourceViewer.getText());
    or
    JTextArea.setText(sourceViewer.getText);
    several things to concider....
    1. you dont have to add the component to abuse it, ie you dont have to show the JEditorPane you can just use its functionality
    2. you cant JUST display the text in anything made to display html unless you removed the <html> tag. but that wont stop you from printing it or putting it into a JTextArea

  • How may I print a pdf doc from access vba code

    I have a directory of files and I want to send these files to the printer in a specific order (right-clicking in the explorer seems to give an unpredictable order).
    I am using the sdk and know how to find the files in the directory, but I can't find any print-method???
    Has anybody any code?

    Thank you!
    Yes I have downloaded the SDK and read the documentation, but obviously not good enough (there are a lot of doc. files). Sorry for that!
    But I have got into a problem since one year ago....
    Looking in the references in Access (2007), I see that the Adobe Acrobat 8.0 Type Libray (Acrobat.tlb) is pointing to my program directory, not to the c:\Program files\Adobe\Acrobat 8.0\Acrobat where the Acrobat.tlb is placed. My program directory does NOT contain this Acrobat.tlb!!!
    When I remove and reconnects to the proper directory, it automatically goes back to point to my program directory (where the Access program is).
    As a result (?) my Access program stops working when I try to open a pdf-document.
    Any ideas what has happended / what to do?

  • Problems with printing MS Office docs from web-mail in Safari

    Hello,
    I have some problems when I try to print MS Office documents which are the attachments in my web-mail in Safari. I open the attachment online without saving it on my computer. Safari shows a blank page in Print Preview and the printer prints a blank page too. We tried to repeat it with another printer and with another iMac. The result is the same. PDF files have no problem with previewing and printing. Does anybody know how to resolve this problem? Thank you!

    Hi, thank you for your comment. I tried this, but the list of plug-ins doesn't have Adobe PDF browser plugin  (or PDF browser plugin). The screenshot is attached....
    Do you have any other idea? ) Thanks!

  • Printing a HTML dokument ?

    Hi!
    How do i print a HTML dokument from Labview witout opening Microsoft
    Explorer ?
    BR Per

    mxller;
    You might be able to do so using "System Exec.vi". The following may vary from computer to computer:
    You need to send "System Exec.vi" the following command:
    rundll32.exe C:\winnt\System32\mshtml.dll,PrintHTML "C:\path\to\file.html"
    This work in a machine with Windows NT. I don't know about Windows 9x/ME/2000 etc. Always check for the correct path for your computer. Unfortunatelly, when I test this, it opens the print dialog instead of just printing the file.
    With Netscape it can be easier. The command is something like:
    C:\PROGRA~1\NETSCAPE\COMMUN~1\PROGRAM\NETSCAPE.EXE /print("C:\path\to\file.html")
    Again, check the path. I tested and in my case it send the file directly to the default printer.
    If I find out something else, I'll p
    ost it here. Let me know if this work.
    Regards;
    Enrique
    www.vartortech.com

  • HP Officejet Pro 8500A Premium will not print docs from computer, but will print a test page.

    HP Officejet Pro 8500A Premium will not print docs from computer, but will print a test page.  I continually get a message that the computer cannot communicate with the printer.   Not only will it not print docs, it will not print web pages using IE 11 or Google Chrome.
    I've used Print and Scan Doctor, it always reports there are no issues and prints a test page even though I can't print anything else. 
    Each time I want to print, I must reboot the computer.  After reboot I have one chance to print.   This problem started February 15, 2015.  
    My operating system is Windows 8.1.   I have unintalled the HP software, rebooted, then reinstalled the software:
    OJ8500_A910_1315-1.exe
    HP Print and Scan Doctor - HPPSdr.exe
    HPSupportSolutionsFramework-11.51.0049.msi
    All versions were last downloaded on April 4, 2015.
    I have a home wireless network (Ubee DDW366 router).  All other devices in the house will print to the 8500A printer without issues:  2 Toshiba laptops, 2 Android phones, and 1FireHD.
    The desk top is installed with a Netgear Network card I don't know the model, but I had it tested by a PC Tech to confirm that the card is working.   The card and Windows 8.1 were installed on January 3, 2015.
    I have run virus scans and malware scans.  Each time they show there are no issues with my desktop.  What kind of desktop? Specifically made to my specs from store parts. . . no brand name computer.  ASUS Motherboard P6X580 Premium.  Now I will probably get hacked!
    I am at my wits end.  And it is frustrating when I need to make a print of something and the system locks up.  I often resort to screen printing to a word document to save in order to reboot. . . .but then I lose all sorts of capabilites when I salvage what I needed.  Also this is a time consumer.
    This printer has served us well for two years and I have expensive cartridges waiting; another two rounds of refills.
    Help?
    Addendum:  I can scan using HP Printer Assistance.  I open the HP Printer assistant, it "retrieves" info from the printer, then I select "scan a document or photo" and the printer responds.   I have no trouble with scanning.
    This question was solved.
    View Solution.

    Hi ArielAce , thanks for getting back to me!
    I would recommend downloading and running the HP Print and Scan Doctor.
    Please keep me posted!
    Please click “Accept as Solution " if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks" for helping!
    Jamieson
    I work on behalf of HP
    "Remember, I'm pulling for you, we're all in this together!" - Red Green.

  • How can I print a doc from my iPhone 4S to a Lexmark Interpret S405 printer with WiFi? Thanks!

    How can I print a doc from my iPhone 4S to a Lexmark Interpret S405 printer with WiFi? Thanks!

    Unfortunately you need an airprint enabled printer to print from an iOS device. There are some work arounds but they are very complicated and aren't proven to work 100%. From what I understand through rumors they are working on allowing all wireless printers to work with iOS but at the moment that's a pipedream. I don't know how important it is but if you really need to print from iPhone you can find some great AirPrint printers on Ebay for decent prices. Good Luck!

  • Print html document from presentation server with no intervention of user

    Hello,
    I have been able to create HTML output for my smartform.
    They are saved on my machine.
    I need to print these HTML outputs as a part of process without intervention of the user.
    Is it possible?
    I have tried method 'EXECWB' of 'cl_gui_html_viewer', but that gets fired only on some action and shows the Print dialog for the selection of printer.
    It would be great if anyone can help me with us.
    Thanks
    Mona

    PDL -- thank you for your reply.
    What you gave me did spawn the print dialog allowing me to select a printer. However, when the document printed, the number of pages in the document was correct but the pages were empty except for the page x of y along the top and the name of the document along the bottom. Have you seen this before and do you know how to correct? Also, how do you suppress the info across the top and bottom of the report from printing?
    Thanks

  • Printing pdf files made from Filemaker docs on HP 7410 cuts off top margin

    Just bought a MacBook Pro and jumped from Tiger to Snow Leopard.
    Also bought FileMaker 10 replacing the FileMaker 8.5 I used up till the MacBook Pro purchase and system upgrade.
    Still using the same HP 7410, but during installation, I think I remember upgrading the printer driver. At any rate, this HP Printer is now much more responsive. It was previously very slow.
    When I now save documents printed as pdf's from filemaker (as I used to) and then try to print them on the HP 7410, they open fine in Preview showing the whole page with no text cut off. But when I press Print in preview and I get the HP driver preview of what will print as part of the print dialogue box, it shows the top margin of the page cut off (down to at least 1/2 ") and actually prints that way. Before the switch to Snow Leopard and the MacBook Pro, a top margin of 1/4 " worked fine and printed in pdf docs.
    (top margins of 1/4" on Word & Excel documents I tested still seem to print fine)
    I use the borderless printing work-around, but that seems inelegant. It also takes much, much............much longer to print when it's in that mode (even fast draft).
    Why is this happening?
    Is there a setting I am missing?
    Can this be fixed?
    Steve

    What print driver are you using?
    I set my printer to use the open source Gutenprint driver in place of the one supplied with my printer to resolve an issue I was having - see my post http://discussions.apple.com/thread.jspa?threadID=1626340&tstart=0
    The Gutenprint home page is http://gutenprint.sourceforge.net/index.php3
    Message was edited by: another_steve

  • After using my macbook for 2 years with same printer,all of a sudden I can't print a page doc even though printer is working and I can print from I/Mail, etc.Anybody had this happen and have a possible answer?

    After using my MacBook Pro and pages for 2 years with the same printer, all of a sudden I can't print a pages doc even though the printer works and I can print from I/Mail, etc. Anyone have a possible answer?

    Often printing problems are a sign of corrupt preferences. Go to HD > Users > (your account) > Library > Preferences, delete the com.apple.iwork.pages.plist file & then restart Pages.

  • My printer will only print the first page of a doc from "Pages" in good quality.

    I've tried reloading drivers etc. Nothing works. My printer prints everything just fine EXCEPT for when I try to print a doc from the PAGES app. Then it only prints the first page (technically the last one prints first) and then all subsequnt pages are very poor quality.
    Lexmark tech support says the problem is not with their drivers.
    Any thoughts as to what the problem might be ??
    THANKS for any help !

    Then use the latest solution!
    Which doesn't need specifying either.
    Peter

  • Macbook Pro Retina OSX v. 10.8.3 -Canon Printer MP560. Printer no longer responds to print commands from the computer, printer and network work but cannot get docs from my macbook to print anymore.

    Until last week, my printer and Macbook worked fine together - could print any doc or pdf, web page from my computer. Then it stopped - my printer will still make copies but will not print anything I send from my Mac. I have checked network connections, the printer WiFi connection works. I have not changed or added any thing different to my settings. I am out of ideas. thanks, Pattee

    Hello Pattee,
    The following article has a number of troubleshooting steps that may help get your Printer working again.
    OS X Mountain Lion: Troubleshoot a network printer
    http://support.apple.com/kb/PH11070
    Make sure you’re on the same network
    Your computer might not be able to find a printer that’s on another local network.
    To see if the printer you want to use is on the same network as your computer, try adding it again. If the printer doesn’t appear in the list of available printers, your computer might be on a different network now.
    If you know the printer’s IP address (for example, 192.168.1.100), you can try adding it as an IP printer. For instructions, see this help topic:Set up an IP printer
    Add your printer again
    Try to add your printer again in Print & Scan preferences. If you can print to the newly added printer queue, delete the old printer queue.
    If you can’t add the printer because it doesn’t appear in the list of available printers, it may be turned off, or your computer may be on another network now. if the printer was shared by another user, the user may have stopped sharing it, or the user’s computer may be offline. If you don’t manage the printer, ask the person who does for help.
    Edit your list of printers
    Set up a printer
    Reset the printing system
    If none of the previous solutions work, the printing system may be corrupted and need to be reset. This removes all printers from your list of printers, deletes information about completed print jobs, and deletes any printer presets.
    Reset the printing system
    Cheers,
    Allen

  • Printing HTML Docs with JPS ???

    Hello!
    How can I print a HTML-File with Java Printing Service (not the source, but the view of it) ???
    Some experience???
    kind regards
    pedros25

    I'm currently trying to do just that. My problem is
    that in order to get a lengthy HTML document to
    print, you have to have an object that
    implements the Pageable interface. The two methods
    I'm having trouble with are
    getNumberOfPages()
    This returns the number of pages in the Print job.
    How do I calculate the number of pages in an HTML
    document?
    getPrintable(int pageIndex)
    For this part, I just rerturn a reference to the JScrollPane which contains the JEditorPane. However,
    I also have to get it to scroll to the appropriate
    page. Right now I'm using the following:
    public void goPage(int pageIndex)
    int block = pane.getScrollableBlockIncrement(scroller.getViewport().getViewRect() ,SwingConstants.VERTICAL,1);
    int newVal = block*pageIndex;
    //scroller.getVerticalScrollBar().setValue(newVal);
    scroller.getViewport().scrollRectToVisible(new Rectangle(0,newVal,this.getSize().width,block));
    But this seems to be causing a few lines to be skipped
    between each page. Any ideas on how to implement the
    pageable interface for a JScrollPane that contains a
    JEditorPane which contains an HTMLDocument?

  • Html doc to printer?

    I am having trouble finding out how to print(send to a printer) out html. I have tried java 1.4's Java print service, but get this error: sun.print.PrintJobFlavorException: invalid flavor, so it seems operation I am trying to do isn't supported. Have enyone an exaple how to print html?

    There is 1 way to do it on Windows, create a file from the application, then make the application run the spooler on the local PC with the location of the file, that should work.
    The other: about that PrintFlavor - does the class implement the PrintGraphics interface? It has to if it wants to print.
    Thats all I know for now.

Maybe you are looking for

  • Embed text in a PDF

    I converted a Microsoft Word document into an Adobe PDF, but the secure website where I tried to upload it said to embed the text in the PDF. How is this done? I have the monthly subscription for $9.99.

  • Email confirmation when customer registers

    Has anybody an idea how we could generate an email after a customer has registered via ICSS ? This email would be used to send the user id (not the password!) and some marketing information. I can imagine using Marketing/Campaign automation and pick

  • CS6 Batch Saving for Web

    CS 6 Version 13.0 I have got the following issue: I did create action to save files of a folder for web. Within the action I have defined the destination folder. So far, everything works fine and the files are saved in that folder in much smaller siz

  • Transfering data from ztable across the r/3 systems by using change pointer

    hi all, what we have to do at the field of domain level when we are transfering data from custom table across the r/3 systems by using change pointers.

  • IPad won't hold a charge

    iPad will not hold a charge.  Can the battery be replaced?