Generate a thumbnail from HTML by pure Java on Linux without Graphics

hi - we in a requirement where we have to generate thumbnails from HTML code. The solution must be implemented in pure Java on Linux where there is no graphics support.
Options tried already are :--
1. 3rd party websites - rolled out by our client.
2. Paid products - rolled out by our client
3. Media Tracker and other java API - no luck as there is no support after HTML 4.0
4. Using any os dependent native library - rolled out by our client.
5. Lobo browser - but having troubles like it opens the browser before screenshot is taken, sometimes. Gone through by putting Thread.sleep() in between and saving remote images into a local html file etc. We got some success in there but problem doesn't end here.
Questions -
1. In the point # 5 above, our Linux server had graphics support but in code we set the system property java.awt.headless= true before capturing and generating thumbnail. My question is, if we set this property in the code then does it mean 100% that our code will not use any graphics support, if present in the underlying OS?
2. Is this really possible to generate images in java on Linux where there is no X window/X server installed? Are we just wasting time in order to achieve which is unachievable?
Any suggestions are most welcome.
Regards,
Sanjeev

Thanks for ur response! Yeah - we tried but requirements are little different. We have HTML that we have to first render. Whatever output comes, we have to take a screenshot. So in order to render the html we have to have a browser first and I believe every OS which is providing browser support is having Graphics capabilities because browser would have frames, windows, toolbars, menubars etc which fall under Graphics.
The above way is the only way that I know. If there are another way which ofcourse doesn't require graphics support, please let me know.
So the question basically is - if I follow above mentioned image (like opening browser and capture screenshot) then is it possible on Linux with no graphics support? Actually I read on internet that lobo browser (written in java) supports this kind of feature.

Similar Messages

  • Generate BIRT design from HTML page

    Hello,
    I'm working on a project that use Birt to generate HTML reports. However, until now those reports were pretty simple and ugly so we wanted to refactor them into something more convenient for us and for the client.
    So, I made a mockup HTML in order to agree on what we wanted, and then I created a pseudo-html-template from it.
    However, now that I want to use Birt to generate it, I can't find a way to create a design from my HTML file. And the thing is that the report is pretty complex to reproduce using Birt's editor (I'd even say impossible to reproduce as is).
    So there is my question: is it possible to create a Birt's template from HTML? Or even better to use directly an HTML file with <value-of> tags (and foreach) as template?
    My question seems pretty trivial, but I just can't find an answer on the web/forum (but maybe I'm just not looking for the good thing).
    Also, do you think I should persue with Birt? Or should I use something like FreeMarker?
    Thanks.
    Michael.
    Ps: If you want an example of the report I'm talking about, it would look to something like that: stuff.stooit.com/d/1/559505733459d/singletest-template2.html

    A BIRT report is an XML file at it's core and is read/executed as such.
    You can place a Text Element inside a report design and it can directly execute and display HTML code.
    Looking at your sample, I am not aware of something that is going to directly convert the HTML you have created into a BIRT report design.
    However, looking at the sample URL you have provided, I think that could be created using the report designer with grids and nested tables with grouping fairly easily. Without knowing more about your data source and reporting requirements it is hard for me to be specific.

  • Generating PDF-files from HTML-page saved as Unicode?

    I have followed this Quick Start on how to generate a PDF-file from HTML using web services in .NET: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/000093.html
    It works just fine when the html-page is saved as ANSI, but when it's saved as UNICODE I get problem. The code runs without errors but the PFD looks really strange. Any suggestions on how to solve this? I really need to use UNICODE as my application needs to handle different languages (including for example Chinese).

    I found out that UTF-8 worked as well so the problem is solved. :-)

  • Printing from SAP GUI for JAVA on linux

    Hi All,
    What are the settings to be made in SPAD for printing from sapgui for java on linux ?
    We are using SAP GUI for JAVA 700 .
    Regards,
    Vinod

    Hi,
    configure printer in SPAD  , no setting for JAVA GUI
    check note
    605467:SAPscript/Smart Forms: Print preview in SAP GUI for Java
    634158      SAPscript/Smart Forms: Print preview in SAP GUI for Java (2)
    1024624 SAPscript/Smart Forms: Print preview in SAP GUI for Java (3)       
    regards,
    kaushal
    regards,
    kaushal

  • How to generate PDF file from HTML file using Acrobat API's

    Hi,
    I want to generate a PDF file from an HTML file on server side(C# .Net).
    Their is a COM interop called "AcrobatWeb2PDF" availaible but could not find any document regarding how to use it.
    I cant use "Adobe live cycle PDF Generator" as we just have license for Adobe Acrobat 8 Professional.
    Please help...
    Thanks and Regards,
    Anand Mahadik.

    > It is hard to believe that Adobe doesn't provide a toolkit for generating PDF files, so many web based applications have vector based content that needs to be converted to PDF!!!!
    They do, it's just not free (A company in business to make money? I'm sure IBM would never think this way... ;)). As mentioned you have Adobe LiveCycle PDF Generator, which you can customize and extend with Java. You also have the Adobe PDF Library SDK, which is written for use with C/C++ although if you license it from Datalogics (the only company in NA Adobe allows to license the PDF Library) you will also get .NET and Java interfaces (part of the DLE - DataLogics Extensions).
    > There must be a way to generate PDF dynamically on a server or from Javascript!
    JavaScript? Not really, no. As far as I'm aware JavaScript has no file system access capabilities without some form of intermediary (like sending the data to a webservice that writes it out to file). How would you create a PDF file with JavaScript?
    The PDF Standard is also in ISOs hands now (ISO 32000-1:2008), it is no longer owned by Adobe - you can download a copy of the specification from them and write your own library based on that as well.

  • Convert XML File from HTML file using java

    Hi All,
    I am trying to convert HTML file into XML file.
    But, Unfortunatelly didnt get the exact result.
    If anyone have a sample code please share with me.
    Any suggestions greatly appreciated.
    Thanks,
    Veera

    You can have a look at [http://sourceforge.net/projects/light-html2xml|http://sourceforge.net/projects/light-html2xml]

  • Get parameters from html page from java application standalone ...

    Hi all,
    I work in one solution that i have values in Html Page and i want get the parameters values from html and cath they in java application standalone.
    The Html page is in same host than de java application.
    I want know if this is possible. I wnat know if without HttpServlet i can get the parameters from Html Page pure.
    Thanks in Advance for the ideas,
    Antonio.

    Hi Abdul,
    The problem is my client want one solution where i have one page simple page Html and one application java standalone. This application runs in one machine, but we don't have web server. So the question is: Is possible without web server i can get the parameters values that is inside the html page from java application. I remember you that the application java is one .jar that run's with one command line from crontab "java -jar teste.jar".

  • Cfpdf don't generate correct thumbnails of CMYK files after installing CF 10 update 1

    Hi,
    We have been using cfpdf to generate a thumbnail from a 1-page PDF file since years, first with CF 8, and now with CF 10. It runs smoothly until yesterday, when we applied the Update 1 (can't assure that there is a correllation, but it's the only thing that has changed: we used the same program to generate the PDFs, and no other changes has been made on the server side).
    Since the update, thumbnail are generated, but almost all text and images are wiped.
    This is what was generated before the update:
    And this is what we get now:
    The code we use is like this:
    <cfpdf action="thumbnail" destination="." source="portada.pdf" pages="1" scale="30" format="jpeg" resolution="high" overwrite="Yes">
    You can get the PDF here (not the same that the above images, but created exactly in the same way).
    PDF file are created with Acrobat Distiller 7.0.5, and have version 1.6 (Acrobat 7.x). Color are in CMYK mode.
    If I convert the CMYK colours of the PDF file to RGB, then cfpdf generates the thumbnail, but with weird colours. Alas, in production we can't send RGB PDFs to generate the thumbnails.
    We have checked with simpler PDFs created with OpenOffice.org 3.2 (version 1.4 Acrobat 5.x), and Acrobat Distiller 9.0.0 (version 1.5 Acrobat 6.x), both of them with RGB colours, and with those cfpdf worked fine and generate a correct image.
    We have CF10 Standard Edition deployed on a virtual machine over CentOS 6.3 64 bits, and although I know CentOS is not officially suportted, I would really appreciate if somebody could reproduce this behaviour over any officially supported Linux enviroment. I've tried on Windows 7 64 bits with the Developer Edition, and cfpdf works as expected, with and without the CF 10 upgrade.
    Thanks in advance,
    Message was edited by: Ernesto RA

    After some time, I found answer how I can repair my MacBook Pro 13" (mid 2010). As I was writing early - Mac Os X update SMC 1.6 broke my computer.
    This is a link on repair instructions: http://habrahabr.ru/sandbox/67092/
    As a result I write this post on my old (but working) MacBook Pro.

  • Thumbnail from PDF is always blank

    Tearing my hair out over this.
    I generate PDF's from a Fujitsu scanner and need to generate png graphics of each page pair (1-2,3-4,5-6 etc) from multi-page document. If I try to generate the thumbnails directly from the document, <CFPDF action="thumbnail" pages="1-2"...> CF fails to generate anything. If I use <CFPDF action="Merge" pages="1-2"....> to generate the page pairs in PDF and then try to generate the thumbnails from the PDF page pairs, the PNG files are generated, but are blank.
    Below is dump of original scanned PDF info:
    struct
    Application
    FUJITSU fi-6130dj
    Author
    [empty string]
    CenterWindowOnScreen
    [empty string]
    ChangingDocument
    Allowed
    Commenting
    Allowed
    ContentExtraction
    Allowed
    CopyContent
    Allowed
    Created
    D:20100304112505-06'00'
    DocumentAssembly
    Allowed
    Encryption
    No Security
    FilePath
    d:\websites\Duval\EA\Documents\PAR\1.pdf
    FillingForm
    Allowed
    FitToWindow
    [empty string]
    HideMenubar
    [empty string]
    HideToolbar
    [empty string]
    HideWindowUI
    [empty string]
    Keywords
    [empty string]
    Language
    [empty string]
    Modified
    D:20100304112551-06'00'
    PageLayout
    SinglePage
    Printing
    Allowed
    Producer
    PDFScanLib v1.2.2 in Adobe Acrobat 7.1
    Properties
    [empty string]
    Secure
    Allowed
    ShowDocumentsOption
    [empty string]
    ShowWindowsOption
    [empty string]
    Signing
    Allowed
    Subject
    [empty string]
    Title
    [empty string]
    TotalPages
    40
    Trapped
    [empty string]
    Version
    1.6

    Usually that means that you have linked to the logical file rather than the correct one. The actual editor is hidden away in the support files folder. The file at the top level of the PSE 12 folder in Applications is just an alias to the welcome screen. You want to choose this one:

  • Generating database tables from Java classes

    Hi,
    I've encountered a number of tools which will create Java classes from database tables (e.g. JDeveloper has this functionality, Abator provides this for iBATIS, etc...).
    However, I've not been able to locate any tools that perform the opposite job - i.e. given a Java class, it generates a database table (or, presumably, some SQL).
    It's been suggested to me that Hibernate might provide this sort of capability, but if anybody has any experience of doing this, in any tool, I'd be interested to hear about it.
    Thanks,
    Alistair.

    Many thanks for the pointers.
    duffymo: I've taken a look at Middlegen (http://boss.bekk.no/boss/middlegen/index.html) but it seems that the first step is to specify the database schema, whereas I'm looking to generate the schema from existing code. Or have I missed something?
    Alistair.

  • Looking for pure Java API to read metadata from an MP4 file.

    Hi, I am looking for a pure Java api that can read MP4 metadata. I have been trying to look online for one but have not found anything
    suitable. If there are no good api's, can someone point me to resources on how to parse metadata from an MP4, tutorials would be great
    as well. I have looked online for that as well but have not found much. Any help would be greatly appreciated.

    Cross posted
    http://www.java-forums.org/new-java/59652-looking-pure-java-api-read-metadata-mp4-file.html
    http://www.coderanch.com/t/580833/Streams/java/Looking-pure-Java-API-read
    http://stackoverflow.com/questions/10568588/looking-for-pure-java-api-to-read-metadata-from-an-mp4-file
    db

  • JNDI error while generating pdf from crystal reports in java

    Hi, i want to generate PDF from crystal reports in java. I have the .PDF file with database configured into the report. Following details are available in report.
    1. Server Name      = testdb
    2. Database Name  = testdb
    3. User
    4. Password
    I am using CR XI.
    In CRConfig.xml i had given following details.
    <JDBC>
         <CacheRowSetSize>100</CacheRowSetSize>
         <JDBCURL>jdbc:oracle:thin:@192.218.216.102:1521://TESTDB</JDBCURL>
         <JDBCClassName>oracle.jdbc.driver.OracleDriver</JDBCClassName>
         <JDBCUserName>user</JDBCUserName>
         <JNDIURL>password</JNDIURL>
         <JNDIConnectionFactory></JNDIConnectionFactory>
         <JNDIInitContext>/</JNDIInitContext>
         <JNDIUserName>testdb</JNDIUserName>
         <GenericJDBCDriver>
              <Default>
                   <ServerType>UNKNOWN</ServerType>
                   <QuoteIdentifierOnOff>ON</QuoteIdentifierOnOff>
                   <StoredProcType>Standard</StoredProcType>
                   <LogonStyle>Standard</LogonStyle>
              </Default>
         </GenericJDBCDriver>
    </JDBC>
    When i am calling from java as standalone, i am getting following error.
    JRCAgent1 detected an exception: Error finding JNDI name (testdb)
    at com.crystaldecisions.sdk.occa.report.lib.ReportSDKException.throwReportSDKException(Unknown Source)      at com.businessobjects.reports.sdk.b.i.if(Unknown Source)
    Can anyone let me know where is the problem?

    Actually, the question boils down to; does the framework support the fonts?
    I believe that my question re. this working in the designer was valid. The designer does not use the framework, so if it works there, it is either a framework issue or a runtime print engine issue.
    I believe if you use the code below, it will list fonts available to the framework:
    foreach(FontFamily ff in FontFamily.Families)
    System.Diagnostics.Debug.WriteLine(ff.Name);
    For more information see kbase [1198306 - Crystal Report displaying incorrect font in Microsoft Visual Studio .NET|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_dev/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333133393338333333303336%7D.do]
    Ludek

  • Problem while calling java function from html

    when i tried to call a java function from html i'm getting an error
    object don't support this property.
    what could be the reason.
    This is my html.
    I got this from this forum only.
    My applet is accessing the system property "user.home".
    I ran it in IE
    <DIV id="dvObjectHolder">Applet comes here</DIV>
    <br><br>
    <script>
    if(window.navigator.appName.toLowerCase().indexOf("netscape")!=-1){ // set object for Netscape:
         document.getElementById('dvObjectHolder').innerHTML = " <object ID='appletTest1' classid=\"java:test.class\"" +
    "height=\"0\" width=\"0\" onError=\"changeObject();\"" +
              ">" +
    "<param name=\"mayscript\" value=\"Y\">" +
    "<param name=\"archive\" value=\"sTest.jar\">" +
    "</object>";
    }else if(window.navigator.appName.toLowerCase().indexOf('internet explorer')!=-1){ //set object for IE
         document.getElementById('dvObjectHolder').innerHTML = "<object ID='appletTest1' classid=\"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93\"" +
              " height=\"0\" width=\"0\" >" +
              " <param name=\"code\" value=\"test.class\" />" +
         "<param name=\"archive\" value=\"sTest.jar\">" +
              " </object>"
    </script>
    <LABEL id="lblOutputText">This text will be replaced by the applet</LABEL>
    <BR>
    <input value="Javascript to java" type=button onClick="document.appletTest1.fromJavaScript()">

    I tried this example using the repy given to an earlier post.
    But its not working with me.
    What i did in addition was adding plugin.jar to classpath to import netscape.javascript.*;
    Let me add some more details
    1) I'll add the stack trace
    2) my java progrma
    3) batch file to sign the applet.
    1) This is the stack trace i don't know whether u will undertand this
    load: class test.class not found.
    java.lang.ClassNotFoundException: test.class
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.FileNotFoundException: C:\FastranJava\AppletObject\bin\test\class.class (The system cannot find the path specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(Unknown Source)
         at java.io.FileInputStream.<init>(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 10 more
    Exception in thread "Thread-5" java.lang.NullPointerException
         at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
         at sun.plugin.AppletViewer.showAppletException(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    2) Java Program
    import netscape.javascript.*;
    import java.applet.*;
    public class test extends Applet
         private JSObject win;
         private JSObject outputLabel;
         private boolean buttonFromJavaClicked=false;
         checkJavaScriptEvent evt=new checkJavaScriptEvent();
         public void init()
              try
                   evt.start();
                   win=JSObject.getWindow(this);
                   outputLabel=(JSObject)win.eval("document.getElementById('lblOutputText')");
                   outputLabel.setMember("innerHTML", "<center><h1>From Init<br>Your Home directory" + System.getProperty("user.home") + "</h1></center>");
              catch(Exception e)
                   e.printStackTrace();
         public void fromJavaScript()
              buttonFromJavaClicked=true;          
         public void fromJavaScript2()
              System.out.println("Started Form JavaScript2");
              try
                   String strLbl="<center><h1>From JavaScript<br>Your Homedir:" + System.getProperty("user.home") + "</h1></center>";
                   outputLabel.setMember("innerHTML", strLbl);
              catch(Exception e)
                   e.printStackTrace();
         class checkJavaScriptEvent extends Thread
              public void run()
                   while(true)
                        if(test.this.buttonFromJavaClicked)
                             System.out.println("OK buttonfromjava is true");
                             test.this.buttonFromJavaClicked=false;
                             fromJavaScript2();
                        try
                             Thread.sleep(3000);
                        catch(Exception e)
                             e.printStackTrace();
    3) Batch file
    del *.cer
    del *.com
    del *.jar
    del *.class
    javac -classpath ".;C:\Program Files\Java\jre1.5.0_06\lib\plugin.jar" test.java
    keytool -genkey -keystore harm.com -keyalg rsa -dname "CN=Harm Meijer, OU=Technology, O=org, L=Amsterdam, ST=, C=NL" -alias harm -validity 3600 -keypass password -storepass password
    jar cf0 test.jar *.class
    jarsigner -keystore harm.com -storepass password -keypass password -signedjar sTest.jar test.jar harm
    del *.class

  • How to Read and Generate XML file from java code.

    hi guys,
    how to read the xml file (Condition :we know only DTD or Shema only).
    How to Generate the new xml file ?(using Shema )
    And one more how directly Generate the xml from DB?
    Pleas with code or any URL

    Using XMLbeans you can generate Java objects from an XSD schema (perhaps DTDs aswell)
    Then you can create an instance of the Document object and ask it to write itself.
    This will create an XML document complient to the schema.
    XMLBeans generates a "type" safe DOM where you can only ever have a structure compilent to you schema.
    matfud

  • Hi I need this asap... "Java code to generate XML File from XML Schema"

    Hi all....
    I need this asap... "Java code to generate XML File from XML Schema i.e XML Schema Definition, XSD file".
    Thankz in advance...
    PS: I already posted in the afternoon... this is the second posting.

    take look at :
    http://sourceforge.net/projects/jaxme/
    this might help...

Maybe you are looking for

  • Drive E doesn't work

    We have tried to get our drive E to work but no matter what I or my daughter does to fix it we can't get the drive to see there is a disc in the drive HELP!!!!

  • Cfspreadsheet and reading the xlsx files issue

    I am trying to process large excel files (65,000 rows) into the DB.  So I try to use the new cfspreadsheet tag to read in the files by 5000 rows at a time and then process the query into the tables.  The process is working fine when reading the (pre

  • TS3103 Mac OS X v10.6: Unable to receive POP mail after updating to 10.6.2

    I have been trying to set up 4 POP mail addresses and can't get them to work properly or at all. One is a Gmail address. I now have the 4.6 version Mail. I have tried every combination and have not succeeded. Does anyone know how to set up POP mail o

  • Help! Logic X keeps crashing...

    Hey there Mac Pro, 6.1, 10.9.4 / Logic 10.0.7 / Universal Audio Apollo Twin After a long period of working with a corrupted old Mac, I emptied my bankaccount and got myself a brandnew Mac Pro with the pre-installed Logic X. Awfully the happiness was

  • QUERY IN SCRIPTS

    HI,     CAN WE MODIFY STANDARD SAP SCRIPT FOR  GOODS RECEIPT SLIP, IF YES, CAN PLS TELL ME THE PROCEDURE. THANKS, SUJITH Moderator message : Search for available information, do not post in all "Capitals". Thread locked. Edited by: Vinod Kumar on Sep