Demo

URL:

 

Render Options:

         

Page Format:

Page Orientation:

Standard:

PDF Delivery:

    

Media Type:


http://runpdf.com/export? EXPORT_KEY=enter your export key here& SOURCE_URL=http://news.google.com& LIVE_LINKS=Y& NO_IMG_BRAKE=Y& SINGLE_PAGE=N& FORMAT=A4& ORIENTATION=P& STANDARD=P& GET_DOCUMENT_INLINE=N& MEDIA_TYPE_PRINT=N
<form method='post' action='http://runpdf.com/export' > 
    
    <input type='hidden' name="EXPORT_KEY" value='enter your export key here' /> 
    
    URL: <input type='text' name="SOURCE_URL" value='http://news.google.com' /><br/> 
    
    Live HTTP links: <input type='text' name="LIVE_LINKS" value='Y' /><br /> 
    
    Avoid image break: <input type='text' name="NO_IMG_BRAKE" value='Y' /><br /> 
    
    Create a Single PDF Page: <input type='text' name="SINGLE_PAGE" value='N' /><br /> 
    
    Page Format: <input type='text' name="FORMAT" value='A4' /><br /> 
    
    Page Orientation: <input type='text' name="ORIENTATION" value='P' /><br /> 
    
    Standard: <input type='text' name="STANDARD" value='P' /><br /> 
    
    PDF Delivery Inline: <input type='text' name="GET_DOCUMENT_INLINE" value='N' /><br /> 
    
    Media Type: <input type='text' name="MEDIA_TYPE_PRINT" value='N' /><br /> 
    
    <input type='submit' name='Submit' value='Submit' /> 

</form>
// Instantiate export client 
ExportClient exportClient = new ExportClient("enter your export key here"); 

// Set export properties 
exportClient.setSourceUrl("http://news.google.com"); 
exportClient.enableLinks(true); 
exportClient.avoidImageBrake(true);  
exportClient.setSinglePage(false); 
exportClient.setFormat(Constants.FORMAT_A4); 
exportClient.setOrientation(Constants.ORIENTATION_PORTRAIT); 
exportClient.setStandard(Constants.STANDARD_PDF); 
exportClient.setMediaTypePrint(false); 

// Below code demonstrates export HTML to PDF in a web service (Java servlet) 
// with an error handling. 
java.io.OutputStream outputStream = null; 
try 
{ 
    // Set the method of delivery of the resultant document  
    // ("attachment" or "inline"). 
    String delivery = "attachment"; 

    // Set javax.servlet.http.HttpServletResponse headers 
    response.addHeader("Content-Type", "application/pdf; charset=utf-8"); 
    response.addHeader("Content-Disposition", delivery + "; filename=test.pdf"); 
    response.addHeader("Set-Cookie", "fileDownload=true; path=/"); 

    // Get OutputStream 
    outputStream = response.getOutputStream(); 

    // Export HTML to PDF 
    long documentSize = exportClient.export(outputStream); 

    response.setContentLength((int) documentSize); 
} 
catch (Exception e) 
{ 
    // Get an error message that corresponds to a specific error code 
    // (see com.runpdf.Constants.ERROR_CODE_MESSAGE_MAP). 
    String errorMsg = exportClient.getErrorMessage("" + e.getMessage()); 
             
    // Handle error 
} 
finally 
{ 
    // Close OutputStream 
    if (outputStream != null)
    { 
        try 
        { 
            outputStream.close(); 
        } 
        catch (IOException e) 
        { 
            // Do nothing: unexpected error closing OutputStream
        } 
    } 
}
// Instantiate export client 
ExportClient exportClient = new ExportClient("enter your export key here"); 

// Set export properties 
exportClient.setSourceUrl("http://news.google.com"); 
exportClient.enableLinks(true); 
exportClient.avoidImageBrake(true); 
exportClient.setSinglePage(false); 
exportClient.setFormat(Constants.FORMAT_A4); 
exportClient.setOrientation(Constants.ORIENTATION_PORTRAIT); 
exportClient.setStandard(Constants.STANDARD_PDF); 
exportClient.setMediaTypePrint(false); 

// Use one of the following methods to export 

// Export HTML to a local file 
string errorMsg = exportClient.exportToFile("enter path to the PDF file"); 
// Export HTML and save the resultant file in the default download location
string errorMsg = exportClient.exportToAttachment(HttpContext.Current.Response);
// Export HTML and open the resultant file in the browser 
string errorMsg = exportClient.exportInline(HttpContext.Current.Response);

if (errorMsg != null) 
{ 
    // Handle error 
}