Page 1 of 1

Embedded fonts in PDF/A

Posted: Fri Oct 09, 2015 11:37 am
by DanielLW
Hello,

when converting pdf-files to the pdf/a-format, on some pdfs i get a NotSupportedException, message "Convert font to embedded font is not supported now (for PDF/A).".

Code: Select all

            Vintasoft.Imaging.Pdf.PdfDocument pdfConvert;
            Vintasoft.Imaging.Pdf.PdfDocument pdfSource;

            pdfSource = new Vintasoft.Imaging.Pdf.PdfDocument(@"D:\test.pdf");

            pdfConvert = new Vintasoft.Imaging.Pdf.PdfDocument(Vintasoft.Imaging.Pdf.PdfFormat.Pdf_A);

            foreach (Vintasoft.Imaging.Pdf.Tree.PdfPage pPage in pdfSource.Pages)
            {
                pdfConvert.Pages.Add(pPage);
            }

            pdfConvert.Save(@"d:\testpdfa.pdf");

            pdfSource.Dispose();
            pdfConvert.Dispose();
I assume that embedding fonts to pdf is not supported by VintaSoft PDF, is it? Can you say, if and when this will be supported?

To workaround this, i have to convert the pdf pages to images/bitmaps, and add them to the new pdf/a-pdf, right?

Is there a way to determine, if a pdf file can be converted to pdf/a without the embedding fonts problem?

Thank you for your support!

Re: Embedded fonts in PDF/A

Posted: Fri Oct 09, 2015 5:31 pm
by Yuri
Hello,

Yes, the embedding of fonts into pdf is not supported at this time. This opportunity would be added in next version 8.3 coming soon, but the ability to check whether the embedded font is compliant with PDF/A standard would be implemented later.

When copying each page separately the common resources of page (if any) will be duplicated. To avoid this is necessary to convert the document at once, using this code:

Code: Select all

 using(Vintasoft.Imaging.Pdf.PdfDocument pdfSource = new Vintasoft.Imaging.Pdf.PdfDocument(@"D:\test.pdf"))
 {
     pdfSource.Pack(@"d:\testpdfa.pdf", Vintasoft.Imaging.Pdf.PdfFormat.Pdf_A);
 }
 
To check whether a font is embedded please use PdfFont.IsFullyDefined property. To get all fonts please use PdfDocument.GetFonts() method.

Rasterization of document undoubtedly removes all fonts, however this mean that your document becomes a fully rasterized one, i.e. it won't be possible to select and extract text from it and all vector graphics will be rasterized with specified resolution.

--
Kind regards,
Yuri

Re: Embedded fonts in PDF/A

Posted: Fri Jan 22, 2016 9:49 am
by Alex
Hello Daniel,

Since version 8.3 SDK allows to embed TrueType fonts into PDF document.

Best regards, Alexander

Re: Embedded fonts in PDF/A

Posted: Wed Feb 03, 2016 11:12 am
by DanielLW
Hello Alex,

great news, thank you!

Re: Embedded fonts in PDF/A

Posted: Thu Feb 04, 2016 5:12 pm
by DanielLW
Hello Alex,

happy too early, with vintasoft.imaging.dll, version 8.3.5.1 and vintasoft.imaging.pdf.dll, version 5.3.5.1, i got the error:

PDF/A-compatible font embedding is not supported now.

at Vintasoft.Imaging.Pdf.PdfDocument.(PdfFormat )
at Vintasoft.Imaging.Pdf.PdfDocument.(Stream , Boolean )
at Vintasoft.Imaging.Pdf.PdfDocument.Save(Stream stream)
at Vintasoft.Imaging.Pdf.PdfDocument.Save(String filename)

Code is the same as before.

Re: Embedded fonts in PDF/A

Posted: Fri Feb 05, 2016 2:39 pm
by Alex
Hello Daniel,
happy too early, with vintasoft.imaging.dll, version 8.3.5.1 and vintasoft.imaging.pdf.dll, version 5.3.5.1, i got the error:
PDF/A document must have embedded fonts only. SDK does not embed fonts into PDF document automatically and you need to do this in your code.

You need modify your code and do the following tasks:
  • Embed fonts into PDF document before saving PDF document
  • Save PDF document as PDF/A document
Best regards, Alexander