PDF Conversion as per USTO Guideline

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.

Hi,


Thanks for contacting support.

Please share the resource file, so that we can test the scenario in our environment. We are sorry for this inconvenience.

Hi,


Thanks a lot for providing the help.
I can not share the file due to its confidentiality.
But I would like to share a sample file, where I am facing 2 issues:

1. When i set :
var document = new Document(@“C:\ABCD.pdf”);
document.EmbedStandardFonts = true;
document.Save(@“C:\ABCD_Output.pdf”);

I get NullReferenceException.

2. When I remove the statement : document.EmbedStandardFonts = true;
And run the program, it generates the output file, but Not all fonts are marked as Embedded Subset, some are marked , some are not.
Which are marked as Embedded Subset, those were already Embedded in original file.
So basically my output file has no effect of the code I ran.

I don’t see any way to attach the pdf file here, please let me know how to attach.

Please help asap, once we get proper output we will buy the PDF and OCR component.

Hi I attached the files.


ABCD.pdf = the original file.
ABCD_Output.pdf = the converted file

Hi,


Thanks for using our API’s.

I have tested the scenario and have managed to reproduce same problem. For the sake of correction, I have logged it as PDFNEWNET-40750 in our issue tracking system. We will further look into the details of this problem and will keep you posted on the status of correction. Please be patient and spare us little time. We are sorry for this inconvenience.