Skip to content
Loading
this code is only convert contain not whole html page ex. images,color
 so,send the code of whole page with color,image convert to pdf
+1
  • krishna vala
    +1












    Chania








    The City


    Chania is the capital of the Chania region on the island of Crete. The city can be divided in two parts, the old town and the modern city.






    What?


    Chania is a city on the island of Crete.


    Where?


    Crete is a Greek island in the Mediterranean Sea.


    How?


    You can reach Chania airport from all over Europe.












    this is my form convert only content to pdfnot convert whole page to pdf
    +1
  • +1
    If you mean the content of your PHP file is HTML, you can use the LEADDocument.convert method from LEADTOOLS to convert the PHP (HTML code) to PDF. You can find more information here:
    https://www.leadtools.com/help/leadtools/v20/dh/javascript/dox/leaddocument-convert.html
    https://www.leadtools.com/sdk/document/document-converter

    The following JavaScript code shows how you can do this using LEADTOOLS SDK:
    1. // JavaScript source code  
    2. var url = "http://www.MyWebSite.com/MyPage.php";  
    3. lt.Documents.DocumentFactory.loadFromUri(url, null)  
    4. .done(function (document) {  
    5.    var myJobData = new lt.Documents.DocumentConverterJobData();  
    6.    myJobData.documentFormat = lt.Documents.Writers.DocumentFormat.pdf;  
    7.    myJobData.rasterImageFormat = lt.Documents.RasterImageFormat.unknown;  
    8.    document.convert(myJobData)  
    9.        .done(function (result) {  
    10.           var resultDoc = result.document != null ? result.document.url : result.archive.url;  
    11.           window.open(resultDoc);  
    12.        })  
    13.        .fail(function (jqXHR, status1, error1) {  
    14.           alert("Error during converting document " + error1);  
    15.        });  
    16. })  
    17. .fail(function (jqXHR, status1, error1) {  
    18.    alert("Error during loading document " + error1);  
    19. }); 
    Note that you can also do the conversion using LEADTOOLS Convert Cloud service for PHP. You can find more information with sample codes here:
    https://services.leadtools.com/documentation/tutorials
    https://services.leadtools.com/documentation/tutorials/php-conversion-tutorial
    +1