Help needed:Printing HTML file using javax.print

Hi
I am using the following code which i got form the forum for rpinting an HTML file.
The folllowing code is working fine, but the problem is the content of HTML file is not getting printed. I am geeting a blank page with no content. What is the change that is required in the code? ALso is there any simpler way to implement this. Help needed ASAP.
public boolean printHTMLFile(String filename) {
          try {
               JEditorPane editorPane = new JEditorPane();
               editorPane.setEditorKit(new HTMLEditorKit());
               //editorPane.setContentType("text/html");
               editorPane.setSize(500,500);
               String text = getFileContents(filename);
               if (text != null) {
                    editorPane.setText(text);                    
               } else {
                    return false;
               printEditorPane(editorPane);
               return true;
          } catch (Exception tce) {
               tce.printStackTrace();
          return false;
     public String getFileContents(String filename) {
          try {
               File file = new File(filename);
               BufferedReader br = new BufferedReader(new FileReader(file));
               String line;
               StringBuffer sb = new StringBuffer();
               while ((line = br.readLine()) != null) {
                    sb.append(line);
               br.close();
               return sb.toString();
          } catch (Exception tce) {
               tce.printStackTrace();
          return null;
     public void printEditorPane(JEditorPane editorPane) {
               try {
                    HTMLPrinter htmlPrinter = new HTMLPrinter();
                    htmlPrinter.printJEditorPane(editorPane, htmlPrinter.showPrintDialog());
               } catch (Exception tce) {
                    tce.printStackTrace();
     * Sets up to easily print HTML documents. It is not necessary to call any of the setter
     * methods as they all have default values, they are provided should you wish to change
     * any of the default values.
     public class HTMLPrinter {
     public int DEFAULT_DPI = 72;
     public float DEFAULT_PAGE_WIDTH_INCH = 8.5f;
     public float DEFAULT_PAGE_HEIGHT_INCH = 11f;
     int x = 100;
     int y = 80;
     GraphicsConfiguration gc;
     PrintService[] services;
     PrintService defaultService;
     DocFlavor flavor;
     PrintRequestAttributeSet attributes;
     Vector pjlListeners = new Vector();
     Vector pjalListeners = new Vector();
     Vector psalListeners = new Vector();
     public HTMLPrinter() {
          gc = null;
          attributes = new HashPrintRequestAttributeSet();
          flavor = null;
          defaultService = PrintServiceLookup.lookupDefaultPrintService();
          services = PrintServiceLookup.lookupPrintServices(flavor, attributes);
          // do something with the supported docflavors
          DocFlavor[] df = defaultService.getSupportedDocFlavors();
          for (int i = 0; i < df.length; i++)
          System.out.println(df.getMimeType() + " " + df[i].getRepresentationClassName());
          // if there is a default service, but no other services
          if (defaultService != null && (services == null || services.length == 0)) {
          services = new PrintService[1];
          services[0] = defaultService;
     * Set the GraphicsConfiguration to display the print dialog on.
     * @param gc a GraphicsConfiguration object
     public void setGraphicsConfiguration(GraphicsConfiguration gc) {
          this.gc = gc;
     public void setServices(PrintService[] services) {
          this.services = services;
     public void setDefaultService(PrintService service) {
          this.defaultService = service;
     public void setDocFlavor(DocFlavor flavor) {
          this.flavor = flavor;
     public void setPrintRequestAttributes(PrintRequestAttributeSet attributes) {
          this.attributes = attributes;
     public void setPrintDialogLocation(int x, int y) {
          this.x = x;
          this.y = y;
     public void addPrintJobListener(PrintJobListener pjl) {
          pjlListeners.addElement(pjl);
     public void removePrintJobListener(PrintJobListener pjl) {
          pjlListeners.removeElement(pjl);
     public void addPrintServiceAttributeListener(PrintServiceAttributeListener psal) {
          psalListeners.addElement(psal);
     public void removePrintServiceAttributeListener(PrintServiceAttributeListener psal) {
          psalListeners.removeElement(psal);
     public boolean printJEditorPane(JEditorPane jep, PrintService ps) {
               if (ps == null || jep == null) {
                    System.out.println("printJEditorPane: jep or ps is NULL, aborting...");
                    return false;
               // get the root view of the preview pane
               View rv = jep.getUI().getRootView(jep);
               // get the size of the view (hopefully the total size of the page to be printed
               int x = (int) rv.getPreferredSpan(View.X_AXIS);
               int y = (int) rv.getPreferredSpan(View.Y_AXIS);
               // find out if the print has been set to colour mode
               DocPrintJob dpj = ps.createPrintJob();
               PrintJobAttributeSet pjas = dpj.getAttributes();
               // get the DPI and printable area of the page. use default values if not available
               // use this to get the maximum number of pixels on the vertical axis
               PrinterResolution pr = (PrinterResolution) pjas.get(PrinterResolution.class);
               int dpi;
               float pageX, pageY;
               if (pr != null)
                    dpi = pr.getFeedResolution(PrinterResolution.DPI);
               else
                    dpi = DEFAULT_DPI;
               MediaPrintableArea mpa = (MediaPrintableArea) pjas.get(MediaPrintableArea.class);
               if (mpa != null) {
                    pageX = mpa.getX(MediaPrintableArea.INCH);
                    pageY = mpa.getX(MediaPrintableArea.INCH);
               } else {
                    pageX = DEFAULT_PAGE_WIDTH_INCH;
                    pageY = DEFAULT_PAGE_HEIGHT_INCH;
               int pixelsPerPageY = (int) (dpi * pageY);
               int pixelsPerPageX = (int) (dpi * pageX);
               int minY = Math.max(pixelsPerPageY, y);
               // make colour true if the user has selected colour, and the PrintService can support colour
               boolean colour = pjas.containsValue(Chromaticity.COLOR);
               colour = colour & (ps.getAttribute(ColorSupported.class) == ColorSupported.SUPPORTED);
               // create a BufferedImage to draw on
               int imgMode;
               if (colour)
                    imgMode = BufferedImage.TYPE_3BYTE_BGR;
               else
                    imgMode = BufferedImage.TYPE_BYTE_GRAY;
               BufferedImage img = new BufferedImage(pixelsPerPageX, minY, imgMode);
               Graphics myGraphics = img.getGraphics();
               myGraphics.setClip(0, 0, pixelsPerPageX, minY);
               myGraphics.setColor(Color.WHITE);
               myGraphics.fillRect(0, 0, pixelsPerPageX, minY);
                    java.awt.Rectangle rectangle=new java.awt.Rectangle(0,0,pixelsPerPageX, minY);
               // call rootView.paint( myGraphics, rect ) to paint the whole image on myGraphics
               rv.paint(myGraphics, rectangle);
               try {
                    // write the image as a JPEG to the ByteArray so it can be printed
                    Iterator writers = ImageIO.getImageWritersByFormatName("jpeg");
                    ImageWriter writer = (ImageWriter) writers.next();
                                   // mod: Added the iwparam to create the highest quality image possible
                    ImageWriteParam iwparam = writer.getDefaultWriteParam();
                    iwparam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT) ;
                    iwparam.setCompressionQuality(1.0f); // highest quality
                    ByteArrayOutputStream out = new ByteArrayOutputStream();
                    ImageOutputStream ios = ImageIO.createImageOutputStream(out);
                    writer.setOutput(ios);
                    // get the number of pages we need to print this image
                    int imageHeight = img.getHeight();
                    int numberOfPages = (int) Math.ceil(minY / (double) pixelsPerPageY);
                    // print each page
                    for (int i = 0; i < numberOfPages; i++) {
                         int startY = i * pixelsPerPageY;
                         // get a subimage which is exactly the size of one page
                         BufferedImage subImg = img.getSubimage(0, startY, pixelsPerPageX, Math.min(y - startY, pixelsPerPageY));
                                             // mod: different .write() method to use the iwparam parameter with highest quality compression
                         writer.write(null, new IIOImage(subImg, null, null), iwparam);
                         SimpleDoc sd = new SimpleDoc(out.toByteArray(), DocFlavor.BYTE_ARRAY.JPEG, null);
                         printDocument(sd, ps);
                         // reset the ByteArray so we can start the next page
                         out.reset();
               } catch (PrintException e) {
                    System.out.println("Error printing document.");
                    e.printStackTrace();
                    return false;
               } catch (IOException e) {
                    System.out.println("Error creating ImageOutputStream or writing to it.");
                    e.printStackTrace();
                    return false;
               // uncomment this code and comment out the 'try-catch' block above
               // to print to a JFrame instead of to the printer
               /*          JFrame jf = new JFrame();
                         PaintableJPanel jp = new PaintableJPanel();
                         jp.setImage( img );
                         JScrollPane jsp = new JScrollPane( jp );
                         jf.getContentPane().add( jsp );
                         Insets i = jf.getInsets();
                         jf.setBounds( 0, 0, newX, y );
                         jf.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
                         jf.setVisible( true );*/
               return true;
          * Print the document to the specified PrintService.
          * This method cannot tell if the printing was successful. You must register
          * a PrintJobListener
          * @return false if no PrintService is selected in the dialog, true otherwise
          public boolean printDocument(Doc doc, PrintService ps) throws PrintException {
               if (ps == null)
               return false;
               addAllPrintServiceAttributeListeners(ps);
               DocPrintJob dpj = ps.createPrintJob();
               addAllPrintJobListeners(dpj);
               dpj.print(doc, attributes);
               return true;
          public PrintService showPrintDialog() {
               return ServiceUI.printDialog(gc, x, y, services, defaultService, flavor, attributes);
          private void addAllPrintServiceAttributeListeners(PrintService ps) {
               // add all listeners that are currently added to this object
               for (int i = 0; i < psalListeners.size(); i++) {
               PrintServiceAttributeListener p = (PrintServiceAttributeListener) psalListeners.get(i);
               ps.addPrintServiceAttributeListener(p);
          private void addAllPrintJobListeners(DocPrintJob dpj) {
               // add all listeners that are currently added to this object
               for (int i = 0; i < pjlListeners.size(); i++) {
               PrintJobListener p = (PrintJobListener) pjlListeners.get(i);
               dpj.addPrintJobListener(p);
          // uncomment this also to print to a JFrame instead of a printer
          /* protected class PaintableJPanel extends JPanel {
               Image img;
               protected PaintableJPanel() {
                    super();
               public void setImage( Image i ) {
                    img = i;
               public void paint( Graphics g ) {
                    g.drawImage( img, 0, 0, this );
Thanks
Ram

Ram,
I have had printing problems too a year and a half ago. I used all printing apis of java and I still find that it is something java lacks. Now basically you can try autosense. To check whether your printer is capable of printing the docflavor use this PrintServiceLookup.lookupPrintServices(flavor, aset); . If it lists the printer then he can print the document otherwise he can't. I guess that is why you get the error.
Regards,
Kevin

Similar Messages

  • Help needed in splitting files using BPM

    Hello experts,
    I am working on an interface where i need to split files within BPM.
    I know,i can achieve it in Message Mapping by mapping Recordset to Target structure and then using Interface Mapping within Transformation step.But i dont want to follow this.Is there an alternative way to achieve this within BPM.
    I have an input file with multiple headers and i need to split for each header.My input file looks like this:
    HXXXXXABCDVN01
    MXXXXXXXXXXXXXX
    MXXXXXXXXXXXXXX
    SXXXXXXXXXXXXXX
    HXXXXXABCDVN02
    MXXXXXXXXXXXXXX
    MXXXXXXXXXXXXXX
    SXXXXXXXXXXXXXX
    HXXXXXABCDVN03
    MXXXXXXXXXXXXXX
    SXXXXXXXXXXXXXX
    Is there a way, where i can specify this condition within BPM , that split files for every H.
    Thanks in advance.
    Regards,
    Swathi

    Hi,
    have your target structure with occurence as 0...unbounded in the mapping and map the header filed to the root node (repeating parent node) of the target structure....this will create as many target messages as the header fileds....if you want to send these messages separately then use a block in BPM with ForEach option....
    Splitting and Dynamic configuration can be applied in the same mapping.
    Regards,
    Abhishek.
    Edited by: abhishek salvi on Dec 18, 2008 12:59 PM

  • Help needed saving excel file using servlet and mailing it as attachment

    Hi,
    I have to enhance an existing application in which (in jsp) using response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition", "attachment=inline");
    and stuff ..
    we are asking user to view or save the file. But now i have to write code to save that xls, and send it as an attachment to other users of the application.
    I am new to this plz help me out
    Thanks in advance
    Regards
    Aashi

    Hi Orlando,
    convert content to Hex format then,
    lw_document = cl_document_bcs=>create_document(
               i_type    = 'RAW / HTM'
               i_text    = lw_main_text
               i_subject = lw_subject ).
          w_document->add_attachment(
             i_attachment_type    = 'XLS'
             i_attachment_subject = lw_att_sub
             i_att_content_text   = p_int_soli[]
             i_att_content_hex    = p_int_solix[] ).
    w_int_address = lw_smtp-low.
                 w_camuser = cl_cam_address_bcs=>create_internet_address( w_int_address ).
                 w_recipient = w_camuser.
    thanks,
    Anil

  • Opening HTML file using a Jbutton

    can anybody tell me how can I open an HTML file using a Jbutton.
    I have a help button on my menu of my GUI. I wanna open a html document using the help (jbutton)
    thank you

    call this class in your button action
    import javax.swing.JInternalFrame;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.net.URL;
    import java.net.MalformedURLException;
    import java.io.*;
    import javax.swing.text.*;
    import javax.swing.JOptionPane;
    import javax.swing.BorderFactory;
    import javax.swing.border.*;
    import javax.swing.JDesktopPane;
    public class Taa extends JFrame implements HyperlinkListener{
         public JEditorPane hh;
         public JScrollPane ss;
    *Taa default constructor
    *@param Nothing
    *@return Nothing
    *@thorws nothing
    *@see descon
    public Taa(){
    //set top left image in the gui
    setIconImage(Toolkit.getDefaultToolkit().getImage("buttons/help.jpg"));
    try{
         File f=new File("Here you can put your html"such as"Help.htm");
         String s = f.getAbsolutePath();
         s = "file:"+s;
         URL url = new URL(s);
    hh=new JEditorPane(s);
    hh.setEditable(false);
    hh.addHyperlinkListener(this);
    catch (MalformedURLException e) {
         System.out.println("Malformed URL: " + e);
    catch (IOException e) {
         System.out.println("IOException: " + e);
         ss=new JScrollPane(hh);
         getContentPane().add(ss);
         setBounds(232,0,490,500);
         setResizable(false);
         show();
    *Implementation of HyperlinkEvent
    public void hyperlinkUpdate(HyperlinkEvent e) {
         if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
         linkActivated(e.getURL());
    *this method activate link
    *@param URL the URL
    *@return Nothing
    protected void linkActivated(URL u) {
         Cursor c = hh.getCursor();
         Cursor waitCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
         hh.setCursor(waitCursor);
         SwingUtilities.invokeLater(new PageLoader(u, c));
    *this class load help files
    class PageLoader implements Runnable {
    *Taa default constructor
    *@param Url the url,Cursor c
    *@return Nothing
    *@thorws nothing
    *@see descon
         PageLoader(URL u, Cursor c) {
         url = u;
         cursor = c;
    public void run() {
         if (url == null) {
              // restore the original cursor
              hh.setCursor(cursor);
              Container parent = hh.getParent();
              parent.repaint();
         } else {
              Document doc = hh.getDocument();
              try {
              hh.setPage(url);
              } catch (IOException ioe) {
              hh.setDocument(doc);
              getToolkit().beep();
              } finally {
              // schedule the cursor to revert after
              // the paint has happended.
              url = null;
              SwingUtilities.invokeLater(this);
         URL url;
         Cursor cursor;

  • How to parse a HTML file using HTML parser in J2SE?

    I want to parse an HTML file using HTML parser. Can any body help me by providing a sample code to parse the HTML file?
    Thanks nad Cheers,
    Amaresh

    What HTML parser and what does "parsing" mean to you?

  • How to display HTML files using ABAP Webdynpro?

    Hi,
    I have a html index file and a bunch of other files accessed by the index file  in a specific directory on the SAP server. I'd like to display the index file via ABAP webdynpro and allow the users to click on what they need to see. How can I achieve this using utilizing the ABAP webdynpro technology ?
    Thanks!

    Hi Thomas,
    Thanks for taking the time to answer my question.
    I have the main html file and all other files needed by the main file in one directory on the application layer of SAP. I'd like to provide the user with a link, by clicking on which they should be able to get to the main html file using the browser. This is just a standalone application.
    I can try the approach using BSPs, however, I'm new to that area. Could you point me in the right direction to get started?

  • How to read HTML files using UTL_FILE

    Hello Friends,
    How to read HTML files using UTL_FILE package ? According
    to Oracle documentation UTL_FILE can read or write OS Text Files.
    Thanx in advance..
    Adi

    HI Hareesh,
    i have gone through that blog.
    i tried it...but i am getting mapping error  no receiver determination fond because there are so  many excel files.
    my data is available on sharedString.xml but also it is in not same order.
    i have no clue how to handle this part form the blog.
    "This way our mapping will receive all data from the sheet in an XML format. The only thing that's left is to create an XSD file from the XML file we received in order to be able to use it in the mapping and as our Service Interface and we can proceed with mapping. As you can see from the sheet.xml files all the data is placed with column name and row number so it's not that difficult to map it to an table type format using the Message Mapping only (no java, abap mapping required)."

  • Pls Help--- URGENT... Combining XML file and HTML file Using java program.

    Hi, I need to implemnt this for my project....
    I need to combine XML and HTML file and generate a new HTML file
    Sample XML File:
    <user>
    <txtName>sun</txtName>
    <txtAge>21 </txtAge>
    </user>
    Sample HTML File:
    <body>
    Name: <input type="text" name="txtName" value=""
    Age : <input type="text" Age="txtAge" value=""
    </body>
    I need a java program to combine the above xml and html files and generate the output in HTML.
    Any kind of help is sincerely Appreciated.
    Thanks.

    toucansam wrote:
    So you want us to write it for you? It's pretty straight forward, first parse the xml file with the *[best java xml parser|http://www.google.com/search?&q=parsing+xml+in+java]* and then go through the nodes and construct the html with strings and concatination. Then write the file using *[the best java file writer|http://www.google.com/search?hl=en&q=writing+to+a+file+in+java]*.
    He would do better to use existing tools that make this easy [http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html|http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html]

  • Help - need printer recommendations

    I just bought a MacBook pro and need a printer for high quality photo printing that will double as an everyday document printer and won't cost me an arm and a leg. Reliability is key - my last printer was absolute crap. Your advice is much appreciated. Thanks!

    i would recommend buying a simple black and white laser printer for your everyday printing needs. i bought a used HP LaserJet 4 off eBay about 5 years ago for $150 shipped. The cartridges for those are about $70-$90, but in 5 years i bought only 2, becayse they last forever. plus that printer has a network connection. The downside is that it is pretty big and ugly.
    You can also find a used HP LaserJet 1100, those are way smaller than the one i have and cartridges run about $50, but you still get the same great laser quiality and dont spend nearly as much money on supplies as you would with an Ink Jet

  • How to mail the html file using javamail????

    hi
    i have captured the output of a jsp page in a html file....
    now i wish to send it in the mail ( *** not as an attachment)
    ie
    i wish the output of the jsp ie the html file to be displayed in
    the message box (ie text area) ..... and then when recieved by the
    receipient it shoud be displayed in the message area....
    is there any way to do this ........

    well as said by my fellow poster googling could have given you quick results.
    Anyways,if you are unable to do so checkout the below code snippet.
    SendMail.java:
    ===========
    import java.io.File;
    import java.io.FileReader;
    import java.io.BufferedReader;
    import java.util.Properties;
    import javax.mail.Session;
    import javax.mail.Message;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;  
    import javax.mail.internet.MimeMessage;
    import javax.activation.*;
    * @Author RaHuL
    * uses SMTP to send Email.
    public class SendMail {
        /** Method used to read contents of html/text/XML file */
        public String readFile(String fileName){
           StringBuffer sb = new StringBuffer();
           BufferedReader input = null;
           try{
               input = new BufferedReader(new FileReader(fileName));
               String str = null;
               while ((str = input.readLine()) != null){    
                      sb.append(line);
           }catch(Exception exp){
               exp.printStackTrace();
           }finally{
                  try {
                        if (input!= null)  
                          input.close(); 
                   }catch (Exception ex) {
                         ex.printStackTrace();
           return sb.toString();
        /** Send an HTML Email with the specific subject to specfic toAddress based on specified fromAddress & Smtp Hostname
          * and returns true on success.
        public boolean sendMail(String toAddress,String fromAddress,String hostName,String subject,String htmlMessage,String contentType) {
           boolean flag = false;    
            try {
                 String to = toAddress;
                 String from = fromAddress;     
                 String host = hostName;
                 // Setting Mail properties
                 Properties props = new Properties();
                 props.put("mail.smtp.host",host);
                 props.put("mail.debug","true");
                 // Getting a New Instance Generated by the API
                 Session session = Session.getInstance(props);
                   NOTE: a Mail Session could be configured and could be got from the Container via JNDI
                         which could be a better practise.
                // Instantiate a message
                Message msg = new MimeMessage(session);
                //Set message attributes
                msg.setFrom(new InternetAddress(from));
                InternetAddress[] address = {new InternetAddress(to)};
                msg.setRecipients(Message.RecipientType.TO, address);
                // Setting Subject Type
                msg.setSubject(subject);
                msg.setSentDate(new Date());
                // Setting Content Type
                msg.setContent(contentType);
                // Set message content
                msg.setText(htmlMessage);
                //Send the message
                Transport.send(msg);
                flag = true;
            }catch (Exception mex) {
             // Prints all nested (chained) exceptions as well
                mex.printStackTrace();
         return flag;
        public static void main(String args[]){
            SendMail sm = new SendMail();
            String htmlMessage = sm.readFile("myHtmlFile.html");
            boolean flag = sm.sendMail("[email protected]","[email protected]","your.smtp.server","EMail SubJect",htmlMessage,"text/html");
            if(flag)
              System.out.println("MAIL SENT SUCCEFULLY");
             else
              System.out.println("MAIL SENDING FAILURE");                          
    }NOTE:
    =====
    Make sure you inculde javamail & java activation libraries.
    Hope that might help :)
    REGARDS,
    RaHuL

  • Edit HTML File using java

    Hi....
    I have a report in HTML format and a list of thresholds in txt format.
    Now, using java how can I:
    1. Compare the values in the report with the thresholds
    2. Edit the report such that values over the thresholds are highlighted in say, red colour.
    I am new to Java programming, so java jargons won't be of much help. I read about jeditorpane but it's primary use is to display html file(that is what i inferred). Is their a way in which i could accomplish the above using jeditorpane??....how do i do the comparison part??

    srgsoroka wrote:
    Did you check http://jtidy.sourceforge.net/.
    From site:
    "JTidy is a Java port of HTML Tidy, a HTML syntax checker and pretty printer. Like its non-Java cousin, JTidy can be used as a tool for cleaning up malformed and faulty HTML. In addition, JTidy provides a DOM interface to the document that is being processed, which effectively makes you able to use JTidy as a DOM parser for real-world HTML."Yes, I did. But I don't need a syntax checker.The syntax is alright. I want to modify the HTML code after comparison with a txt document.As far as DOM parser is concerned, I googled the term but didn't understand much of it..:-(...If you could explain it in layman's terms........

  • 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.

  • Help Needed on Web Report60 using Cartridge

    Dear All,
    I have a simple question and possibly stupid one
    I want to use cartridge to deploy report. After that I do not
    knowhow to set the URL. In the Form Cartridge, there is a base
    HTML,do I need a template HTML to carry the report?
    Any hint will be highly apprecaited!
    Ming
    null

    Following is my rwows60.html file that I use to run reports
    under reports cartridge. I stored it in a directory pointed to
    by virtual path /webhtml/ . The URL to launch it is
    http://ntserver1/webhtml/rwows60.html
    Hope this helps.
    <HTML>
    <!--Form Action is RWCGI60 URL-->
    <FORM
    ACTION="http://ntserver1/developerreports/report60cart?"
    METHOD="POST">
    <!--Parameters not exposed to user are hidden-->
    <INPUT name=server type=hidden value="ReportsServer">
    <INPUT name=paramform type=hidden value="yes">
    <CENTER><H1>Set Reports Multi-tier Server Parameters </H1>
    Report Name: <INPUT name=report type=text value="c:
    \orant\webdemo\deptemp.rdf">
    Database Connection: <INPUT name=userid type=text
    value="scott/[email protected]">
    <INPUT name=destype type=hidden value="cache">
    Output Format: <SELECT name=desformat> <OPTION value=HTMLCSS
    selected> HTMLCSS <OPTION
    alue=PDF> PDF </SELECT>
    <HR><INPUT type=submit value="Run Report!">
    </CENTER> </FORM> </HTML>
    Ming Liu (guest) wrote:
    : Dear All,
    : I have a simple question and possibly stupid one
    : I want to use cartridge to deploy report. After that I do not
    : knowhow to set the URL. In the Form Cartridge, there is a base
    : HTML,do I need a template HTML to carry the report?
    : Any hint will be highly apprecaited!
    : Ming
    null

  • Help needed making SWF file loop

    Hello Everyone-
    I have been researching this topic and am really struggling.
    I'm not much of a HTML guy and I think I'll need to do some to
    resolve my issues. I have searched and searched but I'm not having
    any luck.
    I create an animation in Apple Motion, exported it as a MOV
    and imported it as video into Flash CS3. It was encoded using
    Progressive download from server it creates a FLV file a SWF file
    and an HTML file. My provider is 1and1. I then use Adobe GoLive to
    create my webpage and upload to the web. I need my SWF file to loop
    and I cannot get it to loop.
    In flash. Everything plays fine. When I do a publish preview
    however, the swf file does not loop. I've got the loop option
    checked in my publish preview settings and even in the inspector in
    GoLive but it does nothing.
    Here is the link to the page. And the source code. If anyone
    can help me that would be genius.
    PS there is actually two SWF that I need to loop. Neither of
    them are looping.
    http://www.drewwfilms.com/Index2.html
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="content-type"
    content="text/html;charset=utf-8" />
    <meta name= content="Adobe GoLive" />
    <title>Drew W Films Index</title>
    </head>
    <body>
    <div
    style="position:relative;width:750px;height:571px;margin:auto;-adbe-g:p;">
    <div
    style="position:absolute;top:64px;left:16px;width:720px;height:150px;">
    <object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
    height="150" width="720">
    <param name="loop" value="true" />
    <param name="movie" value="IndexHeader2/IndexHeader2.swf"
    />
    <param name="quality" value="best" />
    <param name="play" value="true" />
    <embed height="150" pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    src="IndexHeader2/IndexHeader2.swf"
    type="application/x-shockwave-flash" width="720" quality="best"
    play="true" loop="true"></embed>
    </object></div>
    <div
    style="position:absolute;top:16px;left:64px;width:624px;height:32px;-adbe-c:c">
    <menumachine name="indexheader2" id="mre8mxf">
    <csobj t="Component"
    csref="menumachine/indexheader2/menuspecs.menudata"><noscript>
    <p><a class="mm_no_js_link"
    href="menumachine/indexheader2/navigation.html">Site
    Navigation</a></p>
    </noscript> </csobj>
    <script type="text/javascript"><!--
    var mmfolder=/*URL*/"menumachine/",zidx=1000;
    //--></script>
    <script type="text/javascript"
    src="menumachine/menumachine2.js"></script>
    <script type="text/javascript"
    src="menumachine/indexheader2/menuspecs.js"></script>
    </menumachine>
    </div>
    <div
    style="position:absolute;top:224px;left:16px;width:720px;height:304px;">
    <object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
    height="304" width="720">
    <param name="loop" value="true" />
    <param name="movie" value="IndexHeader2/IndexBody.swf"
    />
    <param name="quality" value="best" />
    <param name="play" value="true" />
    <embed height="304" pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    src="IndexHeader2/IndexBody.swf"
    type="application/x-shockwave-flash" width="720" quality="best"
    play="true" loop="true"></embed>
    </object></div>
    </div>
    <p></p>
    </body>
    </html>

    The problem you are encountering is that you are telling the
    SWF to loop, when in fact you need to tell the FLV to loop.
    Unfortunately, you need to code a few lines of Actionscript
    to get this to work, you would think that it would be as simple as
    just checking an option.
    I don't know if you have an AS2 or AS3 project, so I'm going
    to give you both for the code.
    Actionscript 2:
    1. Select the FLVPlayback component on the stage.
    2. In the Actions panel, enter the following:
    on(complete){
    this.autoRewind = true;
    this.play();
    Actionscript 3:
    1. Select the FLVPlayback component on the stage, and give it
    an instance name by entering some text in the properties panel.
    (Upper left corner of the panel, right under where it says
    "Component" there is a text input box. This is where you input it.)
    Names are commonly things like "myFLVPlayback" or "myVideo" etc.
    2. Deselect everything.
    3. In the actions panel, enter the following (replacing
    "myVideo" with the instance name you chose):
    myVideo.addEventListener(VideoEvent.COMPLETE,doLoop);
    function doLoop(evt:VideoEvent):void {
    evt.currentTarget.play();
    Either of those blocks of code should work for you. Simply
    add them to your flash project and re-export the SWF.

  • Help needed deleting corrupted file

    G'day,
    I have a corrupted file on my hard disk. It is a Vault backup file created by Aperture. Whenever I do anything with the file (e.g., try to unlock it, try to view info, try to open it), the o/s immediately tells me that I have to manually turn off the system (which is what I understand to be a kernel panic).
    I have tried to delete the file using the terminal window and by placing the file into a folder and moving the folder to trash. In all cases, I'm told to manually shut down the computer (even when I tried to empty the trash).
    It's a 30 gig file, so I'd like to be able to delete it in order to save the hard disk space. Does anyone have any suggestions? I'll reformat the drive if I have to, but I'd prefer to remove just the file.
    Thanks for your help.
    Regards,
    Doug

    Sometimes it happens that the Finder just doesn't want to empty the trash anymore and says "The operation cannot be completed because the item "" is in use.". That's a good warning if it is true, but sometimes you want to get rid of an application and this warning appears even though the only thing running is the Finder. Usually after a restart you can delete it. But that is very time consuming and even then, it is sometimes still stuck not wanting to be deleted. There is a risky command that can be used in the Terminal that will empty the trash no matter what. Risky because a simple error in the syntax could erase a lot of stuff that you want to keep.
    There is a much easier and quicker way of forcing the Finder to empty the trash no matter what! It is done in the freeware customization and maintenance application OnyX (download @ http://www.titanium.free.fr/pgs/english.html ). Once you loaded OnyX and entered your administrator password, choose "Cleaning" in the top bar. Click on the "Trash" tab. You can now choose whether you want to "Delete" or to "Securely Delete" (by overwriting) and click Execute. That's it, it will force the Finder to empty the trash even if the files are in use!
    Also look at these links.
    Solving Trash Problems
    http://www.thexlab.com/faqs/trash.html
    How To Fix Stubborn Trash and Why it Won't Delete
    http://www.osxfaq.com/Tutorials/LearningCenter/HowTo/Trash/index.ws
     Cheers, Tom

Maybe you are looking for

  • Creative Cloud Desktop Sign in doesnt work anymore

    Sign in in creativecloud.de and Adobe.de is no problem. But when I start Creative Cloud Desktop an i want to sign in, it tells me I am signed out. There is no way to install Apps or do anything else at the moment. I habe deinstalled all applications

  • Printing Sub Script in Forms

    Hi Guys,                I want to print a subscript in forms for example H2O(Water) the subscript '2' should be printed down. How can we achieve this in scripts and smartforms. Please note it is not  a text. We can't keep this in text. It is comming

  • Pass parameter to popup window

    I have a popup window that open cfm form(ical.cfm). <SCRIPT language="JavaScript1.2"> function poponload() testwindow= window.open ("ical.cfm", "mywindow",     "location=1,status=1,scrollbars=1,width=300,height=300"); testwindow.moveTo(0,0); </SCRIPT

  • HT201359 How can I open iTunes accont

    So many times I try to open an Id in iTunes but it's nt susfuul

  • Send Files "waiting" but receiver is online

    I'm trying to send an image to a contact that I have that is online and my contact and accepted me as theirs and I can receive images from them but they cannot get any of mine and on my end it just keeps saying that its waiting. .even from my phone.


HashFlare