请问关于c的具体应用场景有哪些?

2026-04-29 05:202阅读0评论SEO基础
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计162个文字,预计阅读时间需要1分钟。

请问关于c的具体应用场景有哪些?

我需要使用C语言。

请问关于c的具体应用场景有哪些?

我需要使用C#代码(.NET 2.0)确定指定PDF文件中的页数. PDF文件将从文件系统中读取,而不是从URL读取.有没有人对如何做到这一点有任何指示?注意:将在执行此检查的PC上安装Adobe Acrobat Reader. 你需要一个C#的PDF API. iTextSharp是一种可能的API,但可能存在更好的API.

iTextSharp示例

您必须安装iTextSharp.dll作为参考.从SourceForge.net下载iTextsharp这是一个使用控制台应用程序的完整工作程序.

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) { // Right side of equation is location of YOUR pdf file string ppath = "C:\\aworking\\Hawkins.pdf"; PdfReader pdfReader = new PdfReader(ppath); int numberOfPages = pdfReader.NumberOfPages; Console.WriteLine(numberOfPages); Console.ReadLine(); } } }

本文共计162个文字,预计阅读时间需要1分钟。

请问关于c的具体应用场景有哪些?

我需要使用C语言。

请问关于c的具体应用场景有哪些?

我需要使用C#代码(.NET 2.0)确定指定PDF文件中的页数. PDF文件将从文件系统中读取,而不是从URL读取.有没有人对如何做到这一点有任何指示?注意:将在执行此检查的PC上安装Adobe Acrobat Reader. 你需要一个C#的PDF API. iTextSharp是一种可能的API,但可能存在更好的API.

iTextSharp示例

您必须安装iTextSharp.dll作为参考.从SourceForge.net下载iTextsharp这是一个使用控制台应用程序的完整工作程序.

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) { // Right side of equation is location of YOUR pdf file string ppath = "C:\\aworking\\Hawkins.pdf"; PdfReader pdfReader = new PdfReader(ppath); int numberOfPages = pdfReader.NumberOfPages; Console.WriteLine(numberOfPages); Console.ReadLine(); } } }