@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.
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.
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.
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?
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.
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