Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how to count the no rows in a pdf file or image file?
Posted
Comments
tanweer 2-Oct-13 3:14am    
will you please elaborate your question?
OriginalGriff 2-Oct-13 3:48am    
That doesn't make a lot of sense as a question: PDF files and image files are very different beasties - and you can't do the same things with them. In particular, a PDF file doesn't have "rows" in the same way that an image file does: it's "row" is flexible depending on the output width and zoom level, where an image generally has a fixed width and height - allowing it to have rows and columns, even if the data may not be stored in that way.
Please, elaborate your question and try to explain in better detail what you are trying to do!
Use the "Improve question" widget to edit your question and provide better information.

Such thing as "number of rows" is not applicable to image, and it is not even applicable to PDF. The question makes no sense. If you define something which you call "number of rows", we can discuss it, but I doubt you can do it.

—SA
 
Share this answer
 
Add iTextSharp.dll as a reference. Download from SourceForge.net
Let try this:

C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iTextSharp.text.pdf;
using iTextSharp.text.xml;
namespace GetPages_PDF
{
  class Program
{
    static void Main(string[] args)
      {
        string pdfPath = "C:\\sources\\helloworld.pdf";
        PdfReader pdfReader = new PdfReader(pdfPath);
        int noOfPages = pdfReader.NumberOfPages;
        Console.WriteLine(noOfPages); 
      }
   }
}
 
Share this answer
 
Comments
OriginalGriff 2-Oct-13 3:50am    
Reason for my vote of one: Since when is a "page" synonymous with a "row"?
Please read the question properly before replying in future.
Sergey Alexandrovich Kryukov 2-Oct-13 4:05am    
Exactly. Makes no sense at all.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900