Convert MS Word to PDF API method of Aspose.Words Cloud returns empty PDF docs

Hi Team,


I am grateful for your Aspose on the Cloud product, the problem I have is that the PDF documents returned when I am testing converting from MS Word are empthy or with zero bytes, what is causing this?

$mainDocumentFile = “/home/mobijxwn/public_html/cvs/My_mobiCV_1326453914.doc”;
echo "File to convert $mainDocumentFile…
";
SaasposeApp::$OutPutLocation = “/home/mobijxwn/public_html/cvs/”;
echo "Coverted file will be output here “/home/mobijxwn/public_html/cvs/”…
";
echo “Converting document…
“;
//create Converter object
$doc = new WordConverter(””);
//save in the required format
$result = $doc->ConvertLocalFile($mainDocumentFile, “My_mobiCV_1326453914.pdf”, “pdf”);

Regards,
Paul


Hi Paul,


Thanks for your inquiry. Could please attach the input Word document file here in this thread? We will take a closer look and guide you accordingly.

Hi there,


My MS Documents are really very basic please find attached, as mentioned I want to convert MS Word to PDF but the PDF are written back to my server but are empty :frowning:

Hi Paul,


Thank you for sharing a sample document. I tested your document against the Aspose cloud service. I’m sorry to share with you that I’m unable to reproduce the problem. I’m attaching a sample application for your reference. Please try this application on your side and let me know your feedback. It is working perfect on my side. Please follow up these steps:

1) Open web browser and browse following URL
http:///ConvertDocumentUsingSDK/index.php
2) Enter App Key and App SID
3) Browse input file from your computer
4) Select output file format
5) Click “Submit” button
6) Save output file to disk

Hi,


Thank you for your reply. I will investigate and revert.

The API I am using is found here https://github.com/aspose-words-cloud/aspose-words-cloud-php

Regards,
Paul

@paulmanjanja

As an update please note we have made a lot of changes in the latest API Version V4.0. Please find the updated sample PHP code using Aspose.Words Cloud SDK for PHP. Please feel free to contact us if you need any help in this regard.

try {

	//TODO: Get your ClientID and ClientSecret at https://dashboard.aspose.cloud (free registration is required).		
	$ClientSecret="xxxxxxxxxxxxxxxxxx";
	$ClientID="xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx";


	$wordsApi = new Aspose\Words\WordsApi($ClientID,$ClientSecret);
	
	
	$format = "pdf";
	$file = ("C:/Temp/02_pages.docx");
    
	$request = new Aspose\Words\Model\Requests\ConvertDocumentRequest($file, $format,null);
	$result = $wordsApi->ConvertDocument($request);	
	copy($result->getPathName(),"02_pages.pdf");
	//print_r($result->getPathName());
        
} catch (Exception $e) {
	echo  "Something went wrong: ",  $e->getMessage(), "\n";
	PHP_EOL;
}