如何计算没有行 [英] how to count no of rows

查看:77
本文介绍了如何计算没有行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何计算pdf文件或图像文件中的无行?

how to count the no rows in a pdf file or image file?

推荐答案

行数这样的东西不适用于图像,它甚至不适用于PDF。这个问题毫无意义。如果你定义一些你称之为行数的东西,我们可以讨论它,但我怀疑你能不能这样做。



-SA
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


添加iTextSharp.dll作为参考。从SourceForge.net下载

试试这个:



Add iTextSharp.dll as a reference. Download from SourceForge.net
Let try this:

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); 
      }
   }
}


这篇关于如何计算没有行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆