pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

ColdFusion pastebin - collaborative debugging tool View Help


Posted by SigmaProjects on Sun 1 Feb 10:52
report abuse | download | new post

  1.         <cffunction name="getURLScreenShot" access="public" output="false" returntype="any">
  2.                 <cfargument name="html" required="false" default="" />
  3.                 <cfargument name="url" required="false" default="" />
  4.                 <cfargument name="width" required="false" default="1024" />
  5.                 <cfargument name="height" required="false" default="768" />
  6.                 <cfargument name="timeout" required="false" default="60000" />
  7.                 <cfscript>
  8.                         var fileName =  GetTempFile(GetTempDirectory(),'urlThumb_');
  9.                         var outputFile = '';
  10.                         var returnFile = '';
  11.                         var prefSize = '';
  12.                         var img = '';
  13.                         var retImg = '';
  14.                         var g = '';
  15.                         var graphics = '';
  16.                         var SwingUtilities = createObject("java", "javax.swing.SwingUtilities");
  17.                         var pane = createObject("java", "javax.swing.JEditorPane").init();
  18.                         var frame = createObject("java", "javax.swing.JFrame").init();
  19.  
  20.                         pane.setEditable(true);
  21.                         pane.setContentType("text/html");
  22.                         if( Len(arguments.html) ) {
  23.                                 pane.setText( toString(arguments.html) );
  24.                         };
  25.                         if( Len(arguments.url) ) {
  26.                                 pane.setPage();
  27.                         };
  28.  
  29.                         frame.pack();
  30.                        
  31.                         sleep(10000);
  32.                        
  33.                         frame.add(pane);
  34.                         frame.pack();
  35.                        
  36.                         prefSize = pane.getPreferredSize();
  37.                         pane.setSize(prefSize);
  38.                        
  39.                         img = createObject("java", "java.awt.image.BufferedImage").init(1027*2, 768*2, 1);
  40.                         g = img.getGraphics();
  41.                        
  42.                         SwingUtilities.paintComponent(g, pane, frame, 0, 0, prefSize.width, prefSize.height);
  43.  
  44.                         retImg = imageNew(img);
  45.                         g.dispose();
  46.  
  47.                 return retImg;
  48.                 </cfscript>
  49.         </cffunction>

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me so that I can delete my post