HTML -- Image (in the background)

Hi All,
I want to be able to create an image from an HTML file. I am thinking about writing my own FAX library and need to send G3 images (JAI - JCA). Can anyone point me in the right direction? I do not want to do a screen shot since that would require showing the HTML on the screen. I would like to be able to convert the HTML to a G3 TIFF in the background.
Thanks in advance,
--Ed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

I am trying to save as a JPEG to begin with... This is my code and I'm having problems. Anyone have any ideas? It is dying on the je.encode(bi) line. Also, for some reason, if I uncomment the commented out lines, it hangs. Any ideas on that one too?
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.FileNotFoundException;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import javax.swing.JEditorPane;
import com.sun.media.jai.codec.ImageCodec;
import com.sun.media.jai.codec.ImageEncoder;
import com.sun.media.jai.codec.JPEGEncodeParam;
public class HTMLPageToImageConverter
     private HTMLPageToImageConverter() {
     static final JEditorPane p;
     static final Object done;
     static {
         done = new Object();
         p = new JEditorPane();
         p.setSize(1728, 2152);
/*         p.addPropertyChangeListener("page", new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) {
             synchronized(done) {
                 done.notifyAll();
     static void GenerateHTMLBufferedImage(File htmlFile, BufferedImage img) {
         img = new BufferedImage(1728, 2152, BufferedImage.TYPE_BYTE_GRAY);
         synchronized(done) {
             try {
                  p.setPage(htmlFile.toURL());
             } catch(IOException e1) {}
/*             try {
                 done.wait();
             } catch(InterruptedException e) { System.out.println("GenerateHTMLBufferedImage InterruptedException"); }
         Graphics g = img.createGraphics();
         g.setColor(Color.white);
         g.fillRect(0, 0, 1728, 2152);
         p.print(g);
     public static boolean SaveHTMLFileToJPEG(String htmlFile, String jpegFile) {
          try {
               BufferedImage bi = null;
               GenerateHTMLBufferedImage(new File(htmlFile), bi);
               FileOutputStream fos = new FileOutputStream(jpegFile);
               JPEGEncodeParam jp = new JPEGEncodeParam();
               ImageEncoder je = ImageCodec.createImageEncoder("JPEG", fos, jp);
               je.encode(bi);
               fos.close();
          } catch(FileNotFoundException fnfe) { System.out.println("SaveHTMLFileToJPEG FileNotFoundException"); }
            catch(IOException ioe) { System.out.println("SaveHTMLFileToJPEG IOException"); }
          return true;
}Called from other code
HTMLPageToImageConverter.SaveHTMLFileToJPEG("d:/page1.html", "d:/page1.jpeg");
...Thanks in advence,
--Ed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Login page - putting an image in the background

    Hi,
    Is there a way to put an image in the background of the login page...?
    right now my login page is plain and white... I am looking for a way to put an image in the background to show some colors
    Thanks

    In APEX the presentational aspects of an application are controlled using a combination of (X)HTML and CSS via themes and templates. These determine the appearance of things like labels, and you're advised to become familiar with them to make best use of APEX.
    There are 3 ways to include CSS in web pages. In this case the easiest is using an internal style sheet. Add a <tt>&lt;style&gt;</tt> element containing the required CSS rules to the HTML Header property in the APEX Page Attributes:
    <style type="text/css">
      Your CSS rules go here
    </style>

  • Loading an image in the background and displaying it as it is loaded

    Hi,
    I'm writing an "image viewer" swing component, which should load an image in the background, and display it as it is loaded (for example each time a line of the image is loaded, display it)
    Is there a way to do this using JAI or any other api ?
    I guess i would need a way to check the loading progress from the EDT, get the loaded part of the image and display it. Am I right ? Is that possible ?
    Thanks,
    Nicolas

    In the video inspector set the Spatial Conform to "none". This will give tou the actual size of the image in the viewer. You can then use the transform controls to adjust the image to what you want to see.

  • How do I put an image in the background of a JDesktop?

    I have made a program that has a JDesktop. Just need to know the coding to put an image in the background of the JDesktop. Any suggestion?

    Add a JLabel that holds a picture to it. Make sure it's in the back layer.

  • Inserting Images in the Background of My Webdynpro Application

    Hi Experts,
    I need your Help. I am a novice to Webdynpro-ABAP and have a requirement  to embed
    Image in the background of my dynpro Application.Kindly suggest me the solution for the same .
    Thanks In advance for your help.

    Hi,
    Please read this [documentation|http://help.sap.com/saphelp_nw70/helpdata/en/46/89af7fbe4d429ee10000000a1553f7/frameset.htm]
    grtz,
    Koen
    Edited by: Koen Labie on Mar 12, 2008 10:30 AM

  • Security Exception when loading Image in the background?

    I've written a javafx app running in the browser. It loads a bunch of images in the background. It worked fine prior JRE 7 u11.
    However it is broken since JRE 7 u13. Images are not loaded correctly, failing with a SecurityException:
    java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup")
         at java.security.AccessControlContext.checkPermission(AccessControlContext.java:366)
         at java.security.AccessController.checkPermission(AccessController.java:560)
         at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
         at sun.plugin2.applet.SecurityManagerHelper.checkAccessHelper(Unknown Source)
         at sun.plugin2.applet.FXAppletSecurityManager.checkAccess(Unknown Source)
         at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:315)
         at java.lang.Thread.init(Thread.java:376)
         at java.lang.Thread.<init>(Thread.java:446)
         at com.sun.javafx.runtime.async.BackgroundExecutor$1.newThread(BackgroundExecutor.java:52)
         at java.util.concurrent.ThreadPoolExecutor$Worker.<init>(ThreadPoolExecutor.java:610)
         at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:924)
         at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1371)
         at com.sun.javafx.runtime.async.AbstractAsyncOperation.start(AbstractAsyncOperation.java:107)
         at javafx.scene.image.Image$ImageTask.start(Image.java:917)
         at javafx.scene.image.Image.cycleTasks(Image.java:798)
         at javafx.scene.image.Image.access$200(Image.java:107)
         at javafx.scene.image.Image$ImageTask.onCompletion(Image.java:903)
         at javafx.scene.image.Image$ImageTask.onCompletion(Image.java:879)
         at com.sun.javafx.runtime.async.AbstractAsyncOperation$2.run(AbstractAsyncOperation.java:70)
         at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
         at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
         at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
         at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
         at com.sun.glass.ui.gtk.GtkApplication$3$1.run(GtkApplication.java:82)
         at java.lang.Thread.run(Thread.java:722)If I dont' load the Image in the background -> it's working. Is it a bug?

    It's probably worth filing a bug report on this.
    https://forums.oracle.com/forums/ann.jspa?annID=1713 "Announcement: How to file a bug or submit a feature request"

  • How do you set a image in the background of a JTextfield?

    How do you set a image in the background of a JTextfield? Any ideas?

    You can't thats why it is called textfield!!!
    Take a look at JScrollPane API for this

  • How do you set an image into the background of a JPanel or JFrame?

    How do you set an image into the background of a JPanel or JFrame?

    Something like this, Ive thrown in an ImageIcon on a
    button too for good measure.
    import java.awt.*;
    import javax.swing.*;
    public class JFrameImage extends JFrame {
    public JFrameImage() {
    Container c    = getContentPane();
    JPanel panel = new JPanel(){
                 public void paintComponent(Graphics g)     {
    ImageIcon img = new
    = new ImageIcon("background.jpg");
                      g.drawImage(img.getImage(), 0, 0, null);
                      super.paintComponent(g);
            panel.setOpaque(false);
    ImageIcon icon = new ImageIcon("onButton.jpg");
    JButton button = new JButton(icon);
    panel.add(button);
    c.add(panel);
    public static void main(String[] args) {
    JFrameImage frame = new JFrameImage();
    frame.setSize(200,200);
    frame.setVisible(true);
    Going totally fancy pants
    ImageIcon bigImage = new ImageIcon(bgImage.getImage().getScaledInstance(getWidth(), getHeight(),Image.SCALE_REPLICATE));
    g.drawImage(bigImage.getImage(), 0, 0, this); Will scale the image to the size of the panel
    whereas
    for (int y = 0; y  < getHeight(); y = y + image.getHeight(null))
    for (int x = 0; x< getWidth(); x = x + image.getWidth(null))
    g.drawImage(image, x, y, this); Will give a tiled effect
    Try tiling with an animated gif and bring your processor to a standstill.

  • I saw Corey Barker do a demo where he extracted an image from the background, then cleaned up the edge with a process that allowed him to de-fringe it.  I can't remember how he did it. And I can't find it.  Help!

    I saw Corey Barker do a demo a few weeks ago where he extracted an image from the background, then used a technique I was not familiar with to clean it up. You selected the area, then did something that involved going either to edit or select, then there was a dialog box that allowed you to dial it in, depending on the color background you were removing.  I can't find this anywhere. Can't remember.  It's driving me crazy!  If someone can help me find this, I would be very glad and grateful. Thanks!  Laura

    In technical support, sometimes you have to make educated guesses. I'm sorry that you were offended.
    iTunes does prompt when it is going to erase a device, and the message is clear.
    She said in her message that she was able to successfully sync the old ipad. This indicated to me that itunes wiping the data was not an issue, because either it had been setup at the apple store (in which case it doesn't actually wipe the ipad despite saying it will*) (*based on a single case I saw), or because the itunes media folder was migrated.
    Furthermore, my solution was to tell her how to backup her ipad (by either doing it manually, or as a last resort, by deleting the corrupt backup -- that she couldn't access anyway.)
    I got that last part of the instructions from the "Taking Control of your iphone" book which I found samples of when I did a google search for "corrupted backup itunes".
    She marked this as a solution, so it worked for her.

  • Image in the Background?

    I want to create a full-screen Mac projector that is 800x600. It turns out that the stage occupies just a small area in the center of the screen with a simple color dominating the remaining area of the screen. My idea was to place an image in the background instead os just a simple color. Or maybe a tile like in webpages.
    Does anybody know if it's possible to use an image that goes beyond the stage borders instead of just a simple color?

    That didn't solve it

  • In the new Pages, how does one send an image to the background (and make it selectable)?

    How does one send an image to the background in the new Pages and how does one make it selectable?

    Also why don't TEXT to Speech short cuts established in system preferences work in the new Pages?
    I am confused (and not completely happy)

  • Satellite Pro L40: black screen but faint image in the background

    Satellite Pro L40-17H (PSL4BE-00T005EN)
    Hello,
    I would appreciate some help with the following problem:
    SYMPTOMS: Screen is black, but I can see that there is a faint image in the background.
    I get a good image in external monitor.
    I suspect, _among others_, that there may be a faulty *lid sensor/switch*, but I have been unable to locate it, although I have disassembled the unit.
    If somebody knows, please let me have the exact *location* where I should look for the switch.
    Thank you

    Thank you RandyRoberts
    You are probably right, it is likely that the inverter is faulty, or it might be a bad lamp.
    Nevertheless, I cannot exclude the possibility that there is a bad or stuck lid switch. That is why I insist to check that one out as well.
    I would still like to know where the lid switch is located on the L40.
    Thanks and regards.

  • Paint an image in the background of the JDesktopPane?

    I need to show an image in the background of an multidocument Java application (Swing based). It's not possible overwritting the method "paint" of the class "JDesktopPane" (appear some problems). Can anybody help me, please? Thanks a lot.

    You have to override the painComponent method not paint.
    JDesktopPane desktop = new JDesktopPane(){
        Image im = (new ImageIcon("background.jpg")).getImage();
        public void paintComponent(Graphics g){
            g.drawImage(im,0,0,this);
    };I hope this helps,
    Denis

  • Pages:  I am trying to put an image to the background of text.  When the image is selected I am unable to click on the Background option.  Help.

    Pages:  I am trying to put an image to the background of text.  When the image is selected I am unable to click on the Background option.  Help.

    Thanks for responding!!!  Please help.  In last years pages version it worked great!!!
    Pages: 5.1
    OSX: 10.9.1
    Template:  Just a Blank.  I am working on a document that I created last year.  Now just making edits.
    Ben

  • How can I place an image hot spot on top of a ap div with an image in the background of the ap div?

    It won't let me

    Right. You can't make an image map out of a background.  You must insert the image directly into the page (HTML markup).  Then apply hotspot tools to the image.
    HTML Image Map
    http://w3schools.com/html/tryit.asp?filename=tryhtml_areamap
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

Maybe you are looking for

  • "weather has been running in the background"

    My iPad said "weather has been running in the background," but las I checked iPad didn't come with the "weather" app. What's the deal?

  • Spry Horizontal Menu not displayed correctly in Internet Explorer 6

    Hello to everyone. I'm creating a website using David's tutorial. My Spry Horizontal Menu is correctly shown in Dreamweaver Live View, Firefox10 but not in IE6. It happears at the bottom of the page. Any advise? Thanks much in advance. Cecilia

  • There's a problem with your computer,s clock

    "it appears that your computer,clock has been set back please reset the clock to  the curent date and time . this prodect wont run unless the clock is set  correctly." I have got this error with my dreamweaver. I have already reinstall my dreamweaver

  • Different instructions for disable arch log mode on 11Gr2 RAC server?

    Hello all, I've run into a problem where I've lost my tape drive...and have no sysadmins to help. I don't want my RAC instances to run our of space and halt, so I'm planning to take them out of archive log mode, and just do exports daily till I can m

  • Is Dictionary shortcut Command-Ctrl-D a system wide thing?

    I had assumed the Command-Ctrl-D for Dictionary.app is a system wide short cut It works fine with Safari But I found it doesnt work in side of a firefox webpage. Pressing the combination doesnt bring up the expected floating dictionary window. Or the