1
A
回答
3
使用iTextSharp的,你可以做到這一點很容易地:
''//File to test
Dim TestFileName = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Test.pdf")
''//Create an object to read the PDF
Dim Reader As New iTextSharp.text.pdf.PdfReader(TestFileName)
''//Get the page size of the first page (iTextSharp page numbers start at 1)
Dim Rect = Reader.GetPageSize(1)
''//Compare the dimensions of the rectangle returned. For simplicity I'm saying that a square object is portraint, too
Dim IsPortrait = Rect.Height >= Rect.Width
1
隨着直線前進接近,你會得到的方式出現約95%。您需要頁面尺寸,您可以從MediaBox中獲得這些尺寸,但是如果它存在的話,確實需要CropBox,因爲它可以將縱向頁面裁剪爲橫向頁面(反之亦然)。此外,您需要查看頁面字典中的旋轉條目,因爲可以在任何指南針點中旋轉頁面。只是爲了讓生活特別有趣,頁面的內容可以呈現任何方向。你可以有一個「直立」的肖像頁面,並將文本上下顛倒。
相關問題
- 1. 如何獲取pdf文檔中的頁面座標onclick
- 2. 獲取PDF文檔中的文檔向量計數?
- 3. 如何使用CAM :: PDF在PDF頁面中獲取文本字符串的文本方向?
- 4. 在.Net中讀取PDF文檔
- 5. 在Rails中獲取PDF中重定向頁面的響應
- 6. iPhone:如何從文檔中獲取PDF文檔的標題?
- 7. 在ASP.net中顯示PDF文檔頁面
- 8. 如何從PDF頁面獲取文本?
- 9. 如何在iFrame的jsf頁面中顯示pdf文檔
- 10. 如何在html中顯示pdf文檔的所有頁面
- 11. 獲取多頁pdf文檔中單個頁面的大小Objective-c
- 12. 如何使用VBA移動PDF文檔中的頁面
- 13. 在html頁面中,如何將pdf文檔的第一頁顯示爲圖標?
- 14. 在.NET中創建PDF/DOCX/HTML文檔
- 15. 如何從HTML頁面獲取PDF(UIWebView)
- 16. 在.NET中讀取文檔
- 17. 如何在iOS上發送pdf文檔的當前頁面
- 18. 如何獲取頁面在vb.net中的URL重定向
- 19. 更改文檔中間的頁面方向
- 20. Novacode DocX同一文檔中的不同頁面方向
- 21. WPF固定文檔中的每個頁面方向
- 22. itextsharp修剪pdf文檔的頁面
- 23. c#如何在word文檔的頁腳中獲取表格
- 24. 如何在保持iTextSharp方向的同時縮放PDF頁面?
- 25. 從SWF Offer中獲取PDF頁面Avis
- 26. 如何使用PDFBox API從PDF獲取文本的方向
- 27. 如何從ASP .NET中的內容頁面獲取表單值
- 28. 在asp.net獲取pdf文檔的當前頁碼
- 29. 獲取PDF文檔大綱
- 30. 如何在appDidBecomeActive中獲取正確的界面方向:(UIApplication *)app?
這個問題可以幫助你嗎? http://stackoverflow.com/questions/1323737/pdfsharp-wrong-pdf-page-settings-when-document-is-opened-in-acrobat – Niklas
你是否已經在使用特定的庫來閱讀PDF文件或者是你的問題? –