Hello,
the title is quite self-explanatory.
Anyway, we are migrating from net framework 4.8 to net8.0.
We used to have something like :
var fonts = documentLoad.UsedFonts;
if (documentLoad.IsAllFontsEmbedded == false)
{
foreach (PdfUsedFont font in fonts)
{
if (font.Type != PdfFontType.TrueTypeEmbedded)
{
documentLoad.EmbedFonts();
}
}
}
Is there anything we can do to achieve the same on Net.Core?
Thanks in advance
Hi,
In our PDF library, the UsedFonts API is only supported in the base platform and it is not supported in the .Net Core platform. So we could not use this approach to embed the non-embedded fonts. However we can use our PDF to PDF/A conversion support, in this support, the non-embedded fonts are embedded. You can refer the following UG documentation for further details.
Working with PDF conformance in .NET PDF Library | Syncfusion
Regards,
Jeyalakshmi T
Thanks for your suggestion JT, it sounds like a good solution. I'll let you know shortly
Kind Regards,
Stefano
Thank you for the update. Please get back to us if you need any other assistance.
Hello JT,
with some further testing, we still have issues with converting PDF, even into PDF\A format.
We can only use PDF A3A because of healthcare standards.
Our code in net core:
public void PdfToPdfA()
{
byte[] pdf = System.IO.File.ReadAllBytes("PDF.pdf");
using (MemoryStream ms_pdf = new MemoryStream(pdf))
{
MemoryStream ms_pdfa3a = new MemoryStream();
using (Syncfusion.Pdf.Parsing.PdfLoadedDocument documentLoad = new Syncfusion.Pdf.Parsing.PdfLoadedDocument(pdf))
{
using (Syncfusion.Pdf.PdfDocument documentSave = new Syncfusion.Pdf.PdfDocument(Syncfusion.Pdf.PdfConformanceLevel.Pdf_A3A))
{
int startIndex = 0;
int endIndex = documentLoad.Pages.Count - 1;
documentSave.ImportPageRange(documentLoad, startIndex, endIndex);
documentSave.Save(ms_pdfa3a);
ms_pdfa3a.Position = 0;
documentSave.Close(true);
}
documentLoad.Close();
}
byte[] pdfa3a = ms_pdfa3a.ToArray();
System.IO.File.WriteAllBytes("PDFA3A.pdf", pdfa3a);
}
}
I'm attaching PDF original file and the converted one as well.
Once again, thanks in advance
Regards,
Stefano
As of now, we don't have the support to convert the PDF document to PDF/A3A conformance. Upon further analyze with your code, we found that you are using import page option to create new document. In this approach the font will not be embedded, because of it only import the exiting content without any update. So we request you to convert your PDF document to PDF/A1B conformance to get all fonts are embedded. You can refer to the UG documentation for more details.
Working with PDF conformance in .NET PDF Library | Syncfusion