Converting pdf with CID Fonts to DocX

Hi,


i have attached Pdf File and want to convert it to DocX using Aspose.Pdf.

Code:

var pdf = new FileSteam(@“myPath\Test.pdf”, FileMode.Open, FileAccess.Read, FileShare.Read)

var srcDoc = new Aspose.Pdf.Document(pdf);

using (var stream = new MemoryStream())
{
srcDoc.Save(stream, Aspose.Pdf.SaveFormat.DocX);
var docX = new Aspose.Words.Document(stream)
}

When saving the PdfDocument to MemoryStream i get an System.ArgumentException telling me, that the Font “CIDFont+F1” could not be found.

How can i solve this?


Greetings,

Crazkur

Hi Crazkur,

Thanks for contacting support.

I have tried to convert your PDF document into DOCX by following code snippet and was unable to reproduce the issue which you have mentioned. I have used Aspose.Pdf 17.3.0 and Aspose.Words 17.3.0 to test the scenario on a machine running Visual Studio 2015 and Windows 10. I am also attaching the generated output document for your reference.

var pdf = new FileStream(dataDir + @“Test.pdf”, FileMode.Open, FileAccess.Read, FileShare.Read);

var srcDoc = new Aspose.Pdf.Document(pdf);

using (var stream = new MemoryStream())

{

    srcDoc.Save(stream, Aspose.Pdf.SaveFormat.DocX);

    var docX = new Aspose.Words.Document(stream);

    docX.Save(dataDir + "TestCID_out.docx");

}

We will really appreciate if you please share your environment information (i.e OS version, API version, Framework Version) so that we can test the scenario again in our environment and get back to you accordingly. We are sorry for the inconvenience.

Best Regards,

Hi,


i am using Aspose.Pdf 11.6.0.0 and Aspose.Words 16.4.0.0
OS is Win 10 and Framework 4.5.2

Greetings.

Crazkur

Hi Crazkur,


Thanks for sharing details with us. I am afraid that you are using quite old versions of the API’s whereas it is always recommended to us the latest version of the API. Please try using latest version of Aspose.Pdf for .NET and Aspose.Words for .NET. In case if you still face any problem please feel free to contact us.



Best Regards,