Hi,
We are
creating a web application, which will convert existing PDF files, in a format, as per the PDF requirements of USPTO. (http://www.uspto.gov/custom-page/pdf-requirements).
So I for that purpose i tried your trial version and tried to achieve above pdf requirements.
I used this code : //Open the document
Document doc = new Document(@"C:\AsposeTry\AsposeTry\NPL_2.pdf");
doc.EmbedStandardFonts = true;
//Iterate through all the pages
foreach (Page page in doc.Pages)
{
if (page.Resources.Fonts != null)
{
foreach (Font pageFont in page.Resources.Fonts)
{
var fontName = pageFont.FontName;
//Check if font is already embedded
if (!pageFont.IsEmbedded)
{
pageFont.IsEmbedded = true;
}
pageFont.IsSubset = true;
}
}
//Check for the Form objects
foreach (XForm form in page.Resources.Forms)
{
if (form.Resources.Fonts != null)
{
foreach (Font formFont in form.Resources.Fonts)
{
//Check if the font is embedded
if (!formFont.IsEmbedded)
{
formFont.IsEmbedded = true;
}
formFont.IsSubset = true;
}
}
}
}
//Save the document
doc.Save("output.pdf");
It converts the image file to text pdf, which i don't want.
And also it doen't embed all fonts.