PDF fields sometimes not readable/visible

Dear,

We use Aspose PDF to read PDF’s altered by clients(the PDF’s that the clients receive are all generated in the same way)

When we receive back the PDF from the client we read all pdf fields and extract the data(in the same way)

This works for some PDF’s we receive but for other PDF’s it happens that some fields are empty and also not visible when you open the PDF(in a browser). When you open the PDF in Adobe Acrobat Pro DC then the fields are visible.

Please tell me what the I can do to extract the necessary data. Thank you.

@IT_bestellingen

Thank you for contacting support.

Would you please share a narrowed down sample application reproducing this issue, along with sample PDF files so that we may try to reproduce and investigate it in our environment. Before sharing requested data, please ensure using Aspose.PDF for .NET 18.10 in your environment.

Hi,

Here is the sample code:
string[] returnValue = new string[] { };
List lines = new List();

        dynamic lic = new Aspose.Pdf.License();
        lic.SetLicense("Aspose.Total.lic");
        
        Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(inputfile);
        Aspose.Pdf.Text.TextAbsorber textAbsorber = new Aspose.Pdf.Text.TextAbsorber();

        Aspose.Pdf.Facades.Form f = new Aspose.Pdf.Facades.Form(pdfDocument);

        if (f.FieldNames.Count() > 1)
        {
            string fName = f.FieldNames[35];
            string outCome = f.GetField(f.FieldNames[34]);
            StreamWriter rW = new StreamWriter(@"c:\temp\output.txt");

            foreach (Field s in pdfDocument.Form.Fields)
            {
                lines.Add(string.Format("{0} § {1}", s.FullName, s.Value));
                rW.WriteLine(string.Format("{0} : {1}", s.FullName, s.Value));
            }
            rW.Close();
        }
        else
        {
            //Old way of doing
            pdfDocument.Flatten();
            pdfDocument.Pages.Accept(textAbsorber);
            lines = textAbsorber.Text.Split(new string[] { System.Environment.NewLine }, StringSplitOptions.None).ToList ();
        }
        
        return lines.ToArray ();

Aspose.pdf: 7.7.0.0
production version 2013.02.05

Reading PDF fields shouldn’t be a problem ? no matter what version.46733 Proof Of Delivery 240918 (1).PDF (294.9 KB)

@IT_bestellingen

Please note that support is provided based on latest available version of the API. We have tested the PDF file with below code snippet but we did not notice any problem. Generated TXT file has also been attached for your kind reference. FieldOutput_18.10.zip

Document pdfDocument = new Document(dataDir + @"46733 Proof Of Delivery.PDF");
Aspose.Pdf.Forms.Form form = pdfDocument.Form;
StreamWriter rW = new StreamWriter(dataDir + @"FieldOutput_18.10.txt");

foreach (Aspose.Pdf.Forms.Field field in form.Fields)
{
    Console.WriteLine(field.Name);
    Console.WriteLine(field.Value);
    rW.WriteLine(string.Format("{0} : {1}", field.FullName, field.Value));
}
rW.Close();

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

Your text file has the same result as I have. If you look at the PDF’s content with a PDF reader (Adobe Acrobat Reader or Adobe Acrobat Pro DC or via internet explorer) you will see that there is header that in that PDF file that is not in your text file.

The result I have is the same as yours. We also tested with our jave license which contains a more recent DLL and also have the same result. We also tested with a no licensed version of the latest version , with the same incomplete result.

Please have again a look at the PDF. The fields below are empty but on the PDF they are filled in.

data[0].PoD_Master_page[0].PoD_First[0].TEST_TEXT[0] : 
data[0].PoD_Master_page[0].PoD_First[0].DOC_DATE[0] : 
data[0].PoD_Master_page[0].PoD_First[0].Customer_data[0].CUST_NUMBER[0] : 
data[0].PoD_Master_page[0].PoD_First[0].Customer_data[0].POD_INVOICED[0] : 
data[0].PoD_Master_page[0].PoD_First[0].Customer_data[0].CUST_VAT[0] : 
data[0].PoD_Master_page[0].PoD_First[0].Supplier_Creditor[0].COMP_NUMBER[0] : 
data[0].PoD_Master_page[0].PoD_First[0].Supplier_Creditor[0].SUPPLIER_ADDRESS[0] : 
data[0].PoD_Master_page[0].PoD_First[0].Supplier_Creditor[0].COMP_VAT[0] : 
data[0].PoD_Master_page[0].PoD_First[0].PoD_texts_above[0].POD_PLEASE[0] : 
data[0].PoD_Master_page[0].PoD_First[0].PoD_texts_above[0].POD_CERTIFICATION[0] : 
data[0].PoD_Master_page[0].PoD_First[0].PoD_texts_above[0].POD_IASCUST[0] : 
data[0].PoD_Master_page[0].PoD_Rest[0].DOC_DATE[0] : 

Can you tell me what is going wrong ?

@IT_bestellingen

Thank you for highlighting the fields with problem.

Would you please share a screenshot or copy the header text that you expect to appear in generated TXT file so that we may proceed further.

Knipsel.zip (90.9 KB)

@IT_bestellingen

We are having the same view as in shared screenshot. Kindly highlight or encircle the header area or text which you are referring to. So that we may verify if that is a field but not present in TXT file.

InkedKnipsel_LI.zip (414.3 KB)

@IT_bestellingen

We have logged a ticket with ID PDFNET-45525 in our issue management system for further investigations 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.

A post was split to a new topic: Login problem

Do you have any news on this ?

@IT_bestellingen

The ticket was recently logged and is currently pending for investigations owing to previously logged tickets. It will be scheduled on its due turn which may take some months. We appreciate your patience and comprehension in this regard.

However, 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.