Date formating or set of locale from doc to pdf

So as the title suggests I am facing the issue where date formatting on pdfs from Word documents comes in the locale of the server which is “mm-dd-yyyy”." In contrast, I want it in a different format say “dd-mm-yyyy”.

I found likes on how to set this in the .net and java library but not for Aspose.Words Cloud SDK for PHP.

Below is how I currently use the library (using Laravel)

        // Instantiate 3rd Party library
        $wordsApi = new WordsApi(config('app.words_api_client_id'), config('app.words_api_client_secret'));
        // Path to our document in Storage/app/public/documents/...
        $documentPath = storage_path('app/public/documents') . DIRECTORY_SEPARATOR . $filename;
        // Convert the document 
        $convertRequest = new ConvertDocumentRequest($documentPath, "pdf");
        // Try to convert the document using the API else throw the error
        try {
            $response = $wordsApi->convertDocument($convertRequest);
        } catch (\Throwable $th) {
            throw $th;
        }
        // File::delete(storage_path('app/public/documents/') . $filename);
        return file_get_contents($response->getPathName(), true);

I tried looking into the source code to see where the localisation is being set but it’s like looking for a needle in a hay stack.

Any guidance is greatly appreciated!

@PLA-Antreas

Please share your input and output documents with us. We will investigate the issue and guide you accordingly.

@tilal.ahmad

Thank you very much for the reply. I have investigated the matter further and come to the conclusion that the document provided (docx) already has the ‘incorrect’ format passed to the Aspose converter but regardless I would still like to know if there is a way to set up a format locale when converting to a pdf.

I cannot share any documents as those are sensitive, but if you require one I could generate a dummy file that replicates the issue!

@PLA-Antreas

Yes, please share some sample input document to replicate the issue. It will help us to investigate and address your issue exactly.