Free Support Forum - aspose.com

Re: Loading PDF results in "To view the full contents of this document- you need a later version of the PDF viewer."

Hi Padmanabhan,


Thanks for contacting support.

I have gone through the problem description but I am afraid I am unable to understand the scenario in which you are getting an error message. I have also tried viewing the attached PDF file in Adobe Reader 10.1.4 and I did not notice any problem. Can you please share some details on how we can replicate this issue at our end. We are really sorry for this inconvenience.

Hi Padmanabhan,


Thanks for contacting support.

I have gone through the problem description but I am afraid I am unable to understand the scenario in which you are getting an error message. I have also tried viewing the attached PDF file in Adobe Reader 10.1.4 and I did not notice any problem. Can you please share some details on how we can replicate this issue at our end. We are really sorry for this inconvenience.

The size of the original file is 1,182,292 bytes.
After executing this line of code

byte[] strFileOne = GetDocument(AODocFormsInput.strSourceFiles[pdfCnt], AODocFormsInput.strUserName, AODocFormsInput.strPassword, AODocFormsInput.strDomain);

strFileOne is 1,182,292 bytes.

However, once the file is loaded using this line

pdfDocument = new Document(mstrFileOne);

pdfDocument is only about 260K and the content of this PDF does not match the original PDF.
The size of this PDF is about 3 KB.
The content just says

To view the full contents of this document, you need a later version of the PDF viewer. You can upgrade
to the latest version of Adobe Reader from www.adobe.com/products/acrobat/readstep2.html
For further support, go to www.adobe.com/support/products/acrreader.html


This document is attached.v

padmanabhang:

The size of the original file is 1,182,292 bytes.
After executing this line of code

byte[] strFileOne = GetDocument(AODocFormsInput.strSourceFiles[pdfCnt], AODocFormsInput.strUserName, AODocFormsInput.strPassword, AODocFormsInput.strDomain);

strFileOne is 1,182,292 bytes.

However, once the file is loaded using this line

pdfDocument = new Document(mstrFileOne);

pdfDocument is only about 260K and the content of this PDF does not match the original PDF.
The size of this PDF is about 3 KB.
The content just says

To view the full contents of this document, you need a later version of the PDF viewer. You can upgrade
to the latest version of Adobe Reader from www.adobe.com/products/acrobat/readstep2.html
For further support, go to www.adobe.com/support/products/acrreader.html


This document is attached.v

Hi Padmanabhan,


Thanks for sharing the details.

As per my understanding, once you have loaded the PDF file using Document class, the complete file is not loaded and when saving the file, the output document is only 3KB. Can you please share the original PDF file which is 1,182,292 bytes so that we can test the scenario at our end. We are sorry for this inconvenience.

PS, In case you face some issue while attaching this document to this forum thread, you may consider uploading it over some free file sharer (FTP) and share the link with us.

The original file was uploaded with the first post - you can see at the top of this page. The file is called 1169NY-CR.pdf

The file that is trunctated is alo attached in this page -it is called 1169NY-CR-Aspose.pdf

Any updates on this issue?

Hi Padmanabhan,


Thanks for sharing the details.

I have been able to get both documents from thread above but I am afraid I am unable to understand the scenario in which you have been facing issue whlie using Aspose.Pdf for .NET. From your first post, I have seen a code snippet and have tried using the same code snippet with Aspose.Pdf for .NET 7.7.0 to read the PDF files but I am unable to notice any problems. Can you please share some details/code snippet on how I can replicate the issue over my end. We are sorry for this inconvenience.

[C#]

Document pdfDocument = new Document();<o:p></o:p>

byte[] strFileOne = System.IO.File.ReadAllBytes("c:/pdftest/1169NY-CR-Aspose.pdf");

MemoryStream mstrFileOne = new MemoryStream(strFileOne);

pdfDocument = new Document(mstrFileOne);

Console.WriteLine(pdfDocument.Pages.Count);

You are loading the wrong file ..

1169NY-CR-Aspose.pdf1169NY-CR-Aspose.pdf is the messed up file.

Try this :

[C#]

Document pdfDocument = new Document();<?xml:namespace prefix = o />

byte[] strFileOne = System.IO.File.ReadAllBytes("c:/pdftest/1169NY-CR.pdf");

MemoryStream mstrFileOne = new MemoryStream(strFileOne);

pdfDocument = new Document(mstrFileOne);

Console.WriteLine(pdfDocument.Pages.Count);

Hi Padmanabhan,


Thanks for sharing the details.

Please allow me to rephrase what I have understood so far.

1169NY-CR.pdf is the source PDF file with size 1.1 MB and you are able to read it contents using Aspose.Pdf for .NET. I have also tried reading this document using Aspose.Pdf for .NET 7.7.0 and re-saved the file and as per my observations, a resultant document of size 1.1 MB is being generated and I am able to open/view the document in Adobe Reader.

[C#]

try<o:p></o:p>

{

byte[] strFileOne = System.IO.File.ReadAllBytes("c:/pdftest/1169NY-CR (1).pdf");

MemoryStream mstrFileOne = new MemoryStream(strFileOne);

Document pdfDocument = new Document(mstrFileOne);

Console.WriteLine(pdfDocument.Pages.Count);

pdfDocument.Save("c:/pdftest/Processsed_pdf.pdf");

mstrFileOne.Close();

}catch(Exception ex)

{Console.WriteLine(ex);}


Secondly, the file 1169NY-CR-Aspose.pdf it self is 3KB document and it contains the message stating "To view the full contents of this document...". I am afraid I am unable to understand the problem that you are facing with this file. We are really sorry for this inconvenience.

Can you please share some further details regarding the problem and the scenario in which you are facing it.

Please try this code:

try

{

Document pdfDocumentOrg = new Document();

byte[] strFileOne = System.IO.File.ReadAllBytes(@“D:\Users\pganesa1\1169NY-CR.pdf”);


MemoryStream mstrFileOne = new MemoryStream(strFileOne);


Document pdfDocument = new Document(mstrFileOne);


Console.WriteLine(pdfDocument.Pages.Count);



pdfDocumentOrg.Pages.Add(pdfDocument.Pages);

pdfDocumentOrg.Save(@“D:\Users\pganesa1\Processsed_pdf.pdf”);

mstrFileOne.Close();


}

catch (Exception ex)

{

Console.WriteLine(ex); }

pdfDocumentOrg does not match the original document.

Aspose Version is 7.6.0.0 - we cannot change to 7.7 since it has breaking changes.

Hi Padmanabhan,


Thanks for providing additional information, I've managed to reproduce the issue at my end and logged it as PDFNEWNET-35060 in our issue tracking system for further investigation and resolution. We will keep you updated regarding issue status via this thread.


Sorry for the inconvenience faced.


<span style=“font-size:10.0pt;line-height:115%;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:Calibri;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>Best Regards,

(see the empty list of standard Acro fields and /NeedsRendering true).

How can I check if the PDF is a XFA form?

Also I have the latest Acrobat reader and I have no problem loading the PDF. I am having problems with the Aspose PDF toolkit. Is there an alternate way of loading the PDF and flattening it ?