Page 1 of 1

The SaveAsPDF method reports a "GenericError" when converting a word document to a pdf document

Posted: Thu Dec 08, 2022 8:19 am
by stoneyuan
The SaveAsPDF method reports a "GenericError" when converting a word document to a pdf document.The word document is uploaded to the Attachments.The code is as follows:
bool convertSuccess = false;
try
{
string license = System.Configuration.ConfigurationManager.AppSettings["DocuViewareLicense"];
if (!string.IsNullOrEmpty(license))
{
DocuViewareLicensing.RegisterKEY(license);
}

using (GdPictureDocumentConverter convert = new GdPictureDocumentConverter())
{
GdPictureStatus status = convert.LoadFromFile(documentPath, GdPicture14.DocumentFormat.DocumentFormatUNKNOWN);

if (status == GdPictureStatus.OK)
{
status = convert.SaveAsPDF(convertPath, pdfConformance);
if (status == GdPictureStatus.OK)
convertSuccess = true;
}
}
}
catch (Exception ex) {
logger.WriteLine("GDPictrue DocuViewareLicensing ConvertDocumentToPDF Method Error:" + ex.Message);
}

return convertSuccess;

Re: The SaveAsPDF method reports a "GenericError" when converting a word document to a pdf document

Posted: Fri Dec 16, 2022 12:38 pm
by Fabio
Hello,

I tried your code snippet on our latest version and everything seems to work fine.
bugconvertdocx.png
Could you try to update your SDK to the latest version and tell me if the issue still occurs, please?

Best regards,
Fabio