Free Support Forum - aspose.com

How To Extract a Font Properties from PDF that has a form

Hi Team,

We need to extract the Font properties of a form from the PDF like Font Family,Font Size,Font color and all of the Form fields inside a PDF using .Net C#.

Attached is the sample file for that.

Kindly provide a solution for that.FormPDF.pdf (446.2 KB)

@ankit_jain_infobeans_com

Thank you for contacting support.

We would like to share with you that you can check different properties of TextBoxField by using the code snippet below:

        Aspose.Pdf.Document doc = new Aspose.Pdf.Document(dataDir + "FormPDF.pdf");
        Aspose.Pdf.Forms.Field[] fields = doc.Form.Fields;
        foreach (Aspose.Pdf.Forms.Field field in fields)
        {
            if (field is Aspose.Pdf.Forms.TextBoxField)
            {
                Console.WriteLine(field.DefaultAppearance.FontSize);
                Console.WriteLine(field.DefaultAppearance.FontName);
                Console.WriteLine(field.DefaultAppearance.TextColor);
            }
        }

We hope this will be helpful. Please feel free to contact us if you need any further assistance.

Thanks for Providing the solution.

I am getting the properties but the font name is not correct like for Helvetia it was just extracting Font name as “Helv”.Similarly for the rest of the text boxes.

Kindly suggest.

@ankit_jain_infobeans_com

We are glad to know that things have started working in your environment. Regarding the problem with font name, we have logged an investigation ticket with ID PDFNET-44841 in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

We are sorry for the inconvenience.

Any update on the Above ticket.

@ankit_jain_infobeans_com

Thank you for getting back to us.

The issue reported by you has been logged in our issue management system a few weeks ago. It is pending owing to previously logged tickets, and will be investigated on its due turn which can take few months. We appreciate your patience and comprehension in this regard.

Moreover, we also offer Paid Support, where issues are used to be investigated with higher priority. Our customers, who have paid support subscription, report their issue there which are meant to be investigated urgently. In case your reported issue is a blocker, you may please consider subscribing for Paid Support. For further information, please visit Paid Support FAQs.