Getting error java.io.IOException: PDF header signature error

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

As per client requirement, I want to try for converting the '.TXT' file '.PDF' file and find then find out the page numbers of pdf file by using the below jars:-

1. Aspose.Words.jdk15.jar

2. aspose-pdf-2.7.0-jdk15.jar

3. aspose-pdf-kit-3.7.0.jar

I have converted successfully from txt file to PDF file but when i am trying for find out the page number of pdf file then i m getting the "PDF header signature error".

Please find the attached java code and could please check the problem based on above jars.

It is urgently can you please check or can you send the java code if it is possible?

Regards,

RSY Narayan

Hi Subramanum,


Thanks for your inquiry. Your query is related to Aspose.Pdf. I am moving this thread to Aspose.Pdf forum. My colleagues from Aspose.Pdf team will reply you shortly.

Hi Subramanum,


Thanks for your inquiry. I’m afraid I’m unable to test your code as there are some missing references, mentioned below. Can you please confirm the Aspose.Words for Java version that you are using in your application.

import com.itextpdf.text.Chunk;
import com.itextpdf.text.Document;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.PdfWriter;

Best Regards,

Hi ,

Thanks for the reply.

I found the solution and it is working fine as per the requirement. So you can close the issue.

Regards,

RSY Narayan

Hi Narayan,


I am glad to hear that your problem seems to be fixed. As per my understanding, the PDF document generated in previous step was not valid. Anyways, please continue using our product and in the event of any further query, please feel free to contact.