Conversion result using ver 24.03 different from https://products.groupdocs.app/conversion/docx-to-pdf#google_vignette

Hi GroupDocs,

I tried to use GroupDocs Conversion ver 24.03, to convert .docx to .pdf but the thai language result is not as expected.
Doc :
image.png (5.5 KB)

Pdf result from conversion :
image.png (14.0 KB)

Pdf result from Online DOCX to PDF converter | Free GroupDocs Apps
image.png (12.5 KB)

My code :
using (var converter = new Converter(pSource))
{
var options = new PdfConvertOptions();
converter.Convert(pTargetExt, options);
}

Is there any other pdf options I should add to get same result from the demo?
Thanks.

Regards,

Ida.
test.docx (89.9 KB)

test_result_from_code.pdf (55.4 KB)

test.pdf (100.3 KB)

1 Like

@1da
This issue is reproduced at our end. Therefore, we have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CONVERSIONNET-7086

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like

Hi @atir.tahir

May I know what does it mean if the issue status is Blocked?
CONVERSIONNET-7086 ---- Status : Blocked

Thanks.

@1da

CONVERSIONNET-7086 is currently blocked by a related internal issue. We’re actively working on resolving this internal issue, and will keep you updated on any progress.

@atir.tahir

May i know what is the status update of the issue?
Also, how can i transfer this ticket to paid support since this one is a free support?

@akhiong0904

This ticket is still under progress, it is actually blocked by another internal ticket that we are currently working on. However, you could avail priority support at GroupDocs paid support helpdesk.

@atir.tahir

We have paid account, how can we transfer this ticket to our account?

@akhiong0904

If you already have a GroupDocs paid support helpdesk account. You can simply create a ticket there and paste this thread reference/link.

@akhiong0904

Please use WordProcessingLoadOptions with property UseTextShaper = true. A complete code snippet is:

FluentConverter
    .Load("test.docx").WithOptions(new WordProcessingLoadOptions
    {
        UseTextShaper = true
    })
    .ConvertTo("test.docx.pdf").WithOptions(new PdfConvertOptions())
    .Convert();

This option is available in API version 24.8.

hi @atir.tahir , thanks for the updates.

FYI, currently we are using GroupDocs.Conversion ver 23.12, if you said this fixes available on API 24.8, meaning we need to upgrade our GroupDocs.Conversion, is it?

@akhiong0904

Yes, this fix was introduced in API version 24.8.

ok thanks, let me try.

1 Like

hi @atir.tahir , could you please advice how to implement the WordProcessingLoadOptions in my current code.

using (var converter = new Converter(() => new MemoryStream(result)))
{
var options = new PdfConvertOptions();
if (pItem.PDFPassword != null && pItem.PDFPassword != “” && pItem.OutputType.ToLower() == PDF)
{
options.Password = pItem.PDFPassword;
}
converter.Convert(() => resultStream, options);
}
result = resultStream.ToArray();

1 Like

@akhiong0904

Looking at your code, you can use WordProcessingLoadOptions as follows:

using (var converter = new Converter(() => new MemoryStream(result), new WordProcessingLoadOptions
{
    UseTextShaper = true
}))
{
    var options = new PdfConvertOptions();

    // Check if a password is specified and output type is PDF
    if (pItem.PDFPassword != null && pItem.PDFPassword != "" && pItem.OutputType.ToLower() == "pdf")
    {
        options.Password = pItem.PDFPassword;
    }

    // Convert the document to PDF
    converter.Convert(() => resultStream, options);
}

// Convert the resultStream to byte array
result = resultStream.ToArray();

If the issue persists, please share a simple console application with us, and we’ll investigate further.

hi @atir.tahir , i try to copy your code inside, but got this error. Could you please advice?
image.png (46.9 KB)

@akhiong0904

Please find the updated code attached.zip (792 Bytes).

image.png (10.8 KB)

don’t have access to see the attachment. @atir.tahir

@akhiong0904

Please let us know if it works at your end:

static void Main()
{
    // Define input and output data
    byte[] result = File.ReadAllBytes(@"D:/test.docx"); // Load your file content
    MemoryStream resultStream = new MemoryStream();

    // Define LoadOptions with UseTextShaper
    Func<LoadOptions> getLoadOptions = () => new WordProcessingLoadOptions
    {
        UseTextShaper = true
    };

    // Define conversion options
    var pdfOptions = new PdfConvertOptions();

    // Define the password and output type (these should be defined as per your actual logic)
    var pItem = new
    {
        PDFPassword = "", // Your logic for password
        OutputType = "pdf" // Ensure this matches your condition
    };

    // Perform the conversion
    using (var converter = new Converter(() => new MemoryStream(result), getLoadOptions))
    {
        // Set the password if necessary
        if (!string.IsNullOrEmpty(pItem.PDFPassword) && pItem.OutputType.ToLower() == "pdf")
        {
            pdfOptions.Password = pItem.PDFPassword;
        }

        // Convert the document and write the result to resultStream
        converter.Convert(() => resultStream, pdfOptions);
    }

    // Get the byte array from the resultStream
    result = resultStream.ToArray();

    // Optionally save the result to a file
    File.WriteAllBytes(@"D:/converted.pdf", result);

    Console.WriteLine("Conversion completed successfully!");
}

You can learn more about WordProcessingLoadOptions here on GitHub.

The issues you have found earlier (filed as CONVERSIONNET-7086) have been fixed in this update. This message was posted using Bugs notification tool by nikola.yankov