## Subscribe to News feed

### Using PHP to Convert files to PDF (and other formats) with the Muhimbi PDF Converter

Posted at: 18:22 on 07 February 2013 by Muhimbi

In this article we explain how to use PHP to convert MS-Word, Excel, PowerPoint, HTML and other common file formats to PDF as well as to other formats. Read on to learn more about the Muhimbi PDF Converter and how it can assist with the Conversion, Merging, Watermarking, Splitting, Securing and OCR of documents.

Please note that the example provided in this post requires our software to be deployed to at least one Windows based server in your environment, after which you can access it from PHP using Windows and non-Windows based systems. If this is a problem for your project then please use our REST based cloud service, which requires no custom software deployment. For details see the examples on GitHub .

One of the interesting aspects of developing a platform independent product such as the Muhimbi PDF Converter Services is that you get to deal with many different programming languages and environments. Many of our customers use Java and .NET, but we are seeing an increased interest in PHP, especially from customers with very large, non-Windows, web farms and those using PHP based products such as Drupal, Joomla, WordPress and TYPO3.

We ship a good amount of sample code with the product, but so far our customers have had to figure things out for themselves when using PHP. That all changes today as we now officially provide PHP sample code. Read on for details.

For those not familiar with the product, the Muhimbi PDF Converter Services is a server based SDK that allows software developers to convert and manipulate typical Office files, including MS-Word, Excel, PowerPoint, Visio, Publisher, AutoCAD, HTML, emails and InfoPath, to PDF and other formats using a robust, scalable but friendly Web Services interface from Java, PHP and .NET based solutions.

Installing PHP

As you are reading this, you probably already have a running PHP environment. If not, and you are running Windows, then you can install PHP as follows:

1. Navigate to http://php.iis.net/ and click Install PHP Now.
2. This launches Microsoft’s Web Platform Installer, which runs you through the process of installing PHP in IIS (version 5.3.19 is the most recent PHP version available at the time of writing).
3. Go through the various screens of the installer. If you wish you can disable the PHP Drivers for Microsoft SQL Server as they are not needed by the PDF Converter.

That is all there is to it. To check that PHP has been installed correctly, and is running on your web site, create a very simple PHP file in your web server root with the following content.

<?php phpinfo(); ?>

Open your browser and navigate to this file to see the output.

Installing the Muhimbi PDF Conversion Services

Using the Muhimbi PDF Conversion Services in combination with PHP requires a standard installation. If PHP is running on the same system as the Muhimbi PDF Converter Services then you can skip steps 2, 3 and 4.

1. Download and Install the Muhimbi PDF Converter Services as described in Chapter 2 of the Administration guide.
2. Open Muhimbi.DocumentConverter.Service.exe.config in your favourite text editor (notepad works as well). A handy shortcut to the configuration / installation folder can be found in the Windows Start Menu Group.
3. Search for baseAddress and change localhost to the DNS name or IP address of the server running the Conversion Service.
4. Restart the Conversion Service as follows:
Net stop "Muhimbi Document Converter Service"
Net start "Muhimbi Document Converter Service"

Please use the included Diagnostics Tool to verify that your installation is correct.

Generating proxies

Although out-of-the-box PHP comes with a SoapClient class to interact with web services, it is much easier to pre-generate proxy classes to talk to the web service.

Many tools are available for generating PHP proxies. The one that we are using in this tutorial is wsdl2phpgenerator. Starting with version 7.0 Pre-generated proxies are included in the Muhimbi PDF Converter Services’ Sample Code folder. You can also generate your own proxies using the following steps:

2. Make sure PHP is added to your path (In windows this is done for you if PHP has been installed using the steps at the top of this tutorial).
3. Open a command prompt and navigate to the location where wsdl2phpgenerator was unzipped.
4. Execute the following command to generate the PHP proxies:

php wsdl2php.php -s -i "http://localhost:41734/Muhimbi.DocumentConverter.WebService/?wsdl" -o documentConverterServices

If the Conversion Service is running on a remote machine then please replace ‘localhost’ with the name of that machine.
5. Copy the newly generated documentConverterServices.php file to the folder that holds your PHP code.

Sample Code

The sample code has been kept as simple as possible and is available for download here.

Create the following index.html file that allows a file to be uploaded and the output file type to be set.

<html>
<body>
<form action="convert.php" method="post" enctype="multipart/form-data">
<a href="phpInfo.php">PHP Info</a>
<br/>
<label for="file">Document:</label>
<input type="file" name="file" id="file" />
<br/>
<label for="outputFormat">Output format:</label>
<select name="outputFormat" id="outputFormat">
<option value="PDF">PDF</option>
<option value="XPS">XPS</option>
<option value="DOCX">DOCX</option>
<option value="DOC">DOC</option>
<option value="ODT">ODT</option>
<option value="RTF">RTF</option>
<option value="TXT">TXT</option>
<option value="MHT">MHT</option>
<option value="HTML">HTML</option>
<option value="XML">XML</option>
<option value="XLS">XLS</option>
<option value="XLSX">XLSX</option>
<option value="CSV">CSV</option>
<option value="ODS">ODS</option>
<option value="PPT">PPT</option>
<option value="PPTX">PPTX</option>
<option value="ODP">ODP</option>
<option value="PPS">PPS</option>
<option value="PPSX">PPSX</option>
</select>
<br/>
<input type="submit" name="submit" value="Convert" />
</form>
</body>
</html>

The HTML page submits the file to the following PHP file:

<?php
// Include the generated proxy classes
require_once "documentConverterServices.php";
if ($_FILES["file"]["error"] > 0) { echo "Error uploading file: " .$_FILES["file"]["error"];
}
else
{
// Get the uploaded file content
$sourceFile = file_get_contents($_FILES["file"]["tmp_name"]);

// Create OpenOptions
$openOptions = new OpenOptions(); // set file name and extension$openOptions->FileExtension = pathinfo($_FILES["file"]["name"], PATHINFO_EXTENSION);$openOptions->OriginalFileName = $_FILES["file"]["name"]; // Create conversionSettings$conversionSettings = new ConversionSettings();
// Set the output format
if(isset($_POST["outputFormat"])) {$conversionSettings->Format = $_POST["outputFormat"]; } else {$conversionSettings->Format = "PDF";
}
// Set fidelity
$conversionSettings->Fidelity = "Full"; // These values must be set to empty strings or actual passwords when converting to non PDF formats$conversionSettings->OpenPassword="";
$conversionSettings->OwnerPassword=""; // Set some of the other conversion settings. Completely optional and just an example$conversionSettings->StartPage = 0;
$conversionSettings->EndPage = 0;$conversionSettings->Range = "VisibleDocuments";
$conversionSettings->Quality = "OptimizeForPrint";$conversionSettings->PDFProfile = "PDF_1_5";
$conversionSettings->GenerateBookmarks = "Automatic";$conversionSettings->PageOrientation="Default";
// Create the Convert parameter that is send to the server
$convert = new Convert($sourceFile, $openOptions,$conversionSettings);
// Create the service client and point it to the correct Conversion Service
$url = "http://localhost:41734/Muhimbi.DocumentConverter.WebService/?wsdl";$serviceClient = new DocumentConverterService(array(), $url); // If you are expecting long running operations then consider longer timeouts ini_set('default_socket_timeout', 60); try { // Execute the web service call$result = $serviceClient->Convert($convert)->ConvertResult;
// Send the resulting file to the client.
header("Content-Disposition: attachment; filename=\"convert." . $conversionSettings->Format . "\""); echo$result;
}
catch (Exception $e) { print "Error converting document: ".$e->getMessage();
}
}
?>


Place all files in the same folder under your web server root. Open a web browser and point it to index.html. Select a file, specify the output format and click ‘Convert’.

This is just a simple example. The full object model, including details about merging, splitting and watermarking files, is available in the Developer Guide.

If you expect to execute long running operations then you may want to read-up on dealing with PHP socket timeouts:

Troubleshooting

If you are experiencing any problems with our sample code, e.g. warning messages such as Missing argument 1 for OpenOptions then please read the comment dated 15 November, 2013 09:12 at the end of this post.

If you cannot make our Windows’ based solution work, please consider our Cloud based REST service, which requires no deployment of Windows software.

SOAP / Web Service Debugging

The Muhimbi Conversion Service is a Windows Service based on the Microsoft Windows Communication Foundation (WCF) framework. This comprehensive framework is used to expose a standards based Web Services interface that can be consumed by many different platforms including .NET, Java, PHP, SAP, Documentum and many others.

Even though WCF Web Services are standards based, standards are not interpreted the same by everyone so from time to time you may need to do some troubleshooting when programming against  the PDF Converter Web Service, especially from non-Microsoft platforms.

For details about how to debug Web Service / SOAP messages, see this Knowledge Base Article.

.

Labels: , , ,

• that's bullshit!!! many errorssssss! GRRRRR -_-

By  Anonymous,

• Hi Anonymous,

I am sorry to see you are feeling frustrated by our PHP sample code.

There is not much detail in your comment so I have to make some assumptions, forgive me if I made the wrong ones. You are probably getting some warnings similar to 'Missing argument 1 for OpenOptions'.

In the proxies generated by wsdl2php all parameters on the class constructor are mandatory (they don't default to null), which is why you are seeing some warnings.

This is not a problem with the default php.ini settings, but if warnings are enabled you may see extra messages. If I remember correctly, adding / modifying the following line in php.ini will make the warnings go away.

error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING

Alternatively you can modify the generated proxy classes and specify a default value of 'null' for all parameters. This is a bit of a pain as you need to redo this change every time you regenerate the proxies.

public function __construct($UserName = null,$Password = null, $FileExtension = null,$OriginalFileName = null, $RefreshContent = null,$AllowExternalConnections = null, $AllowMacros = null) Another option is to actually pass all parameters into the constructor from your own code. This is not particularly nice either, but may do the trick. We have an open task to make this exact change in our sample code and update this blog post. Next time you have a problem, why don't you drop our support desk a line at support@muhimbi.com, we love talking to our customers as long as you keep it constructive. By Muhimbi, • ( ! ) Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost:41734/Muhimbi.DocumentConverter.WebService/?wsdl' : failed to load external entity "http://localhost:41734/Muhimbi.DocumentConverter.WebService/?wsdl" in D:\wamp\www\PHP\documentConverterServices.php:99 Stack trace: #0 D:\wamp\www\PHP\documentConverterServices.php(99): SoapClient->SoapClient('http://localhos...', Array) #1 D:\wamp\www\PHP\convert.php(64): DocumentConverterService->__construct(Array, 'http://localhos...') #2 {main} thrown in D:\wamp\www\PHP\documentConverterServices.php on line 99 By Anonymous, • It looks like you are generating your code proxies against a remote system. Have a look at this KB article for details about how to solve this http://support.muhimbi.com/entries/23660787-Generating-Web-Service-proxies-against-a-remote-machine-fails If you require further assistance then please contact support@muhimbi.com. They are always happy to help. By Muhimbi, • new OpenOptions(???, ???, ....) By khanh, • Hi Khanh, I am afraid your comment does not provide much detail although I guess it may be similar in nature to an earlier comment. Please read the comment dated '15 November, 2013 09:12 ' or contact support@muhimbi.com. By Muhimbi, • Fatal error: Class 'SoapClient' not found in C:\wamp\www\PHP-Sample-Code\documentConverterServices.php on line 20 By Anonymous, • Hi Anonymous, please drop support@muhimbi.com a line if you need assistance with the PHP sample code. This example is known to work well, but - as we are no PHP experts - perhaps there is an environmental issue that needs tweaking on your side. By Muhimbi, • this fatal error apperared to me too ( ! ) Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost:41734/Muhimbi.DocumentConverter.WebService/?wsdl' : failed to load external entity "http://localhost:41734/Muhimbi.DocumentConverter.WebService/?wsdl" in D:\wamp\www\PHP\documentConverterServices.php:99 Stack trace: #0 D:\wamp\www\PHP\documentConverterServices.php(99): SoapClient->SoapClient('http://localhos...', Array) #1 D:\wamp\www\PHP\convert.php(64): DocumentConverterService->__construct(Array, 'http://localhos...') #2 {main} thrown in D:\wamp\www\PHP\documentConverterServices.php on line 99 can you post a clear solution for that? By Anonymous, • Sounds like you are generating proxies against a remote system, see http://support.muhimbi.com/entries/23660787-Generating-Web-Service-proxies-against-a-remote-machine-fails By Muhimbi, • Hello Muhimbi, thanks for this post But I'm getting some different type of error like Warning: Missing argument 1 for ConversionSettings::__construct(), called in E:\xampp\htdocs\convert_doc_to_pdf\convert.php on line 37 and defined in E:\xampp\htdocs\convert_doc_to_pdf\documentConverterServices.php on line 1613 By SĦußħåm Vëŕmå, • Please see the 'troubleshooting' section in this blog post (in red) or contact support@muhimbi.com. By Muhimbi, • I am getting following URL while executing the script: Error converting document: Class '\ConvertResponse' not found Test it at: https://secure.nsbep.org/PDFConversion/ By Anonymous, • Hi, please drop support@muhimbi.com a line. By Muhimbi, • hi, I want php code for pdf to excel converter By Jafar m, • Hi Jafar, I am afraid that out-of-the box our software converts Excel to PDF. In order to convert PDF to Excel you need a 3rd party add-on as per http://blog.muhimbi.com/2014/07/choices-choices-choices-pdf-to-xlsx-pdf.html By Muhimbi, • Dear sir/Madam: I meet the same problem with some one up, I've already install the server program and change the localhost to local ip then it starts to work. after click convert then there shows the following warning: Warning: Missing argument 1 for OpenOptions::__construct(), called in D:\htdocs\pm\pdf\convert.php on line 31 and defined in D:\htdocs\pm\pdf\documentConverterServices.php on line 1473 Warning: Missing argument 2 for OpenOptions::__construct(), called in D:\htdocs\pm\pdf\convert.php on line 31 and defined in D:\htdocs\pm\pdf\documentConverterServices.php on line 1473 Warning: Missing argument 3 for OpenOptions::__construct(), called in D:\htdocs\pm\pdf\convert.php on line 31 and defined in D:\htdocs\pm\pdf\documentConverterServices.php on line 1473 Warning: Missing argument 4 for OpenOptions::__construct(), called in D:\htdocs\pm\pdf\convert.php on line 31 and defined in D:\htdocs\pm\pdf\documentConverterServices.php on line 1473 Warning: Missing argument 5 for OpenOptions::__construct(), called in D:\htdocs\pm\pdf\convert.php on line 31 and defined in D:\htdocs\pm\pdf\documentConverterServices.php on line 1473 Warning: Missing argument 6 for OpenOptions::__construct(), called in D:\htdocs\pm\pdf\convert.php on line 31 and defined in D:\htdocs\pm\pdf\documentConverterServices.php on line 1473 Warning: Missing argument 7 for OpenOptions::__construct(), called in D:\htdocs\pm\pdf\convert.php on line 31 and defined in D:\htdocs\pm\pdf\documentConverterServices.php on line 1473 ........ Line 31 is :$openOptions = new OpenOptions();
seems that function need arguments , like new OpenOptions(???,??,xxxx);

Shawn

By  Shawn Gao,

• Hi Shawn,

By  Muhimbi,

• Hello Mr,
I have the same problem as Anonymous who commented on 05 July 2014 and I can't solve my problem
help me please and thank you

By  KHOUYA ABDEL MOULA,

• Hi Khouya,

In that case the answer is probably the same as the answer to that comment :-).

By  Muhimbi,

• Merci Monsieur mais j'ai encore des problèmes et toujours ce message apparaître :
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost:41734/Muhimbi.DocumentConverter.WebService/?wsdl' : failed to load external entity "http://localhost:41734/Muhimbi.DocumentConverter.WebService/?wsdl" in C:\wamp\www\conversionDocuments\wsdl2phpgenerator-master\documentConverterServices.php:99 Stack trace: #0 C:\wamp\www\conversionDocuments\wsdl2phpgenerator-master\documentConverterServices.php(99): SoapClient->SoapClient('http://localhos...', Array) #1 C:\wamp\www\conversionDocuments\wsdl2phpgenerator-master\convert.php(64): DocumentConverterService->__construct(Array, 'http://localhos...') #2 {main} thrown in C:\wamp\www\conversionDocuments\wsdl2phpgenerator-master\documentConverterServices.php on line 99

By  KHOUYA ABDEL MOULA,

• It sounds like you are generating proxies against a remote system, see http://support.muhimbi.com/entries/23660787-Generating-Web-Service-proxies-against-a-remote-machine-fails

By  Muhimbi,

• Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost:41734/Muhimbi.DocumentConverter.WebService/?wsdl' : failed to load external entity "http://localhost:41734/Muhimbi.DocumentConverter.WebService/?wsdl" in C:\xampp\htdocs\sample\documentConverterServices.php:99 Stack trace: #0 C:\xampp\htdocs\sample\documentConverterServices.php(99): SoapClient->SoapClient('http://localhos...', Array) #1 C:\xampp\htdocs\sample\convert.php(64): DocumentConverterService->__construct(Array, 'http://localhos...') #2 {main} thrown in C:\xampp\htdocs\sample\documentConverterServices.php on line 99

By  RAGHVENDRA KUMAR,

• Hi Raghvendra,

It sounds like you are running the PHP code on a system that is not running our Conversion Service. Please install the Muhimbi PDF Converter Services on one of your systems. If it is the same system that you run your PHP code on then it should work fine out of the box. If the Conversion Service is running on a remote system then change 'localhost' in the code to the name or ip-address of the appropriate system.

By  Muhimbi,

• Hi muhimbi,

so many error in you post

Notice: Undefined variable: OriginalFileName in D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php on line 1478

Notice: Undefined variable: EndPage in D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php on line 1616

Notice: Undefined variable: Range in D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php on line 1617

Notice: Undefined variable: Quality in D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php on line 1618

Notice: Undefined variable: PDFProfile in D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php on line 1619

Notice: Undefined variable: OpenPassword in D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php on line 1620

Notice: Undefined variable: OwnerPassword in D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php on line 1621

Notice: Undefined variable: SecurityOptions in D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php on line 1622

Notice: Undefined variable: Fidelity in D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php on line 1623

Notice: Undefined variable: GenerateBookmarks in D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php on line 1624

Notice: Undefined variable: Watermarks in D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php on line 1625

Notice: Undefined variable: PageOrientation in D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php on line 1626

Notice: Undefined variable: ConverterSpecificSettings in D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php on line 1627

Notice: Undefined variable: OutputFormatSpecificSettings in D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php on line 1628

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost:41734/Muhimbi.DocumentConverter.WebService/?wsdl' : failed to load external entity "http://localhost:41734/Muhimbi.DocumentConverter.WebService/?wsdl" in D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php:99 Stack trace: #0 D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php(99): SoapClient->SoapClient('http://localhos...', Array) #1 D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\convert.php(64): DocumentConverterService->__construct(Array, 'http://localhos...') #2 {main} thrown in D:\GOKULAN_WORK\03.WAMP_SERVER\wamp\htdocs\pdftocsv\documentConverterServices.php on line 99

Check and Update New one

By  GOKULAN R,

• Hi Gokulan,

This code is known to work well, but you may get errors because of some of your PHP settings. See the 'Troubleshooting' section highlighted in red above.

By  Muhimbi,

• Hi Muhimbi,

We have encountered a problem upon executing the following command to generate the PHP proxies:

php wsdl2php.php -s -i "http://localhost:41734/Muhimbi.DocumentConverter.WebService/?wsdl" -o documentConverterServices

The error says that :

Fatal error: Cannot redeclare class Generator in "Path of the wsdl2phpgenerator-master" \src\Generator.php on line 30

Also there have an error "Class 'SoapClient' not found " upon converting a document using index.php.
We already applied the instruction from the "https://support.muhimbi.com/entries/23660787-Generating-Web-Service-proxies-against-a-remote-machine-fails" but we still getting the same error.

Please note that when we run "http://localhost:41734/Muhimbi.DocumentConverter.WebService/?wsdl" on the browser, It is running correctly and give you XML an output data.

We are using PHP 5.5.38.

By  Anonymous,

• Hi,

I am afraid we are no PHP or wsdl2php experts. However, our software comes with pregenerated PHP proxies (in the 'Sample Code' folder), why not use those?

If you are getting warnings when executing our sample then see the 'troubleshooting' section (in red) in the main blog post above.

I am afraid that we cannot provide PHP programming assistance beyond our sample code, but feel free to reach out to support@muhimbi.com if you have any further questions.

By  Muhimbi,

By  Anonymous,

• Hi,

Please contact support@muhimbi.com to exchange details. The sample code shipped alongside our product is known to work well.

By  Muhimbi,

• Hi,

please solve the problem . when i convert the file then apache HTTP Server has stopped warking

By  yogesh todiwan,

• Hi Yogesh,

Our software does not provide a client side component so does not have the ability to crash Apache (at least not from our code). Now, something may go wrong in Apache when dealing with a potential large incoming or outgoing request. You may want to check your Apache settings, log or memory allocation or possibly the PHP integration.

Normally I'd propose to contact support@muhimbi.com, but they have little Apache or PHP specific knowledge.

By  Muhimbi,

• Is there any way that we can install this application via composer, bcz .exe file will not be run on server. If possible pls provide me the command which we can run this on server.
Thank you...

By  Anik Roy,

• Hi Anik,

I am afraid that is not possible. You need to install this software on a Windows Server. The good news is that it can be any Windows Server, once installed you can access the API remotely from another systems.

What may be a better option is to use our new Hosted Facility (We host the servers) and access the various functionality via a REST interface. We are about to release this, please contact support@muhimbi.com if you would like more details.

By  Muhimbi,

• This error shows on my page i am installed on myhosting. what i do with script please tell me ASAP.

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost:41734/Muhimbi.DocumentConverter.WebService/?wsdl' : failed to load external entity "http://localhost:41734/Muhimbi.DocumentConverter.WebService/?wsdl" in /home/fdcpa/public_html/demo/test/documentConverterServices.php:99 Stack trace: #0 /home/fdcpa/public_html/demo/test/documentConverterServices.php(99): SoapClient->SoapClient('http://localhos...', Array) #1 /home/fdcpa/public_html/demo/test/convert.php(64): DocumentConverterService->__construct(Array, 'http://localhos...') #2 {main} thrown in /home/fdcpa/public_html/demo/test/documentConverterServices.php on line 99

By  Unknown,

• Hi,

Did you follow the full instructions above and deploy our Conversion Service to one of your servers as well? It looks like you just copied the script without deploying the prerequisites.

If you prefer a hosted service (where you don't need to install anything) then please check out our REST based service. Many PHP samples can be found at https://github.com/Muhimbi/PDF-Converter-Services-Online/tree/master/clients/v1/php

By  Muhimbi,

• Fatal error: Class 'SoapClient' not found in C:\xampp\htdocs\pdf_to_html\New folder\documentConverterServices.php on line 21

By  Girish bagmor,

• HI Girish,

I see you have already contacted our support desk.

Please follow ALL instructions in the article above including the installation of our software on your server. The sample code as provided - without installation of our software on your server - will not work.

If you prefer to use a Cloud service, that doesn't require installation of any of our software, please see the text highlighted in red at the top of this article.

The sample code for the Online service can be found at https://github.com/Muhimbi/PDF-Converter-Services-Online/tree/master/clients/v1/php

By  Muhimbi,

Access our Forum