When I embed a pdf as an ole object into a document and then save as PDF fonts are lost with aspose.words 20.10 for .net.
Sample code:
static void WordEmbedPDF(string pathToPDF, string pathToImagePart)
{
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Stream soueceStream = File.OpenRead(pathToImagePart);
MemoryStream dataStream = new System.IO.MemoryStream();
soueceStream.CopyTo(dataStream);
soueceStream.Close();
builder.InsertOleObject(pathToImagePart, false, false, dataStream);
PdfSaveOptions options = new PdfSaveOptions();
options.EmbedFullFonts = true;
options.Compliance = PdfCompliance.PdfA1a;
doc.Save(pathToPDF + "-ole-output.pdf", options);
doc.Save(pathToPDF + "-ole-output.docx");
}
I have attached the input and output files. Note that the lorem_ipsum.pdf-ole-output.pdf has lost it’s header font styling.
insert ole.zip (1.4 MB)