如何在 C# 中检测 OCR 的页面旋转 | IronOCR

How to Detect Page Rotation

This article was translated from English: Does it need improvement?
Translated
View the article in English

确定页面旋转涉及确定文档中页面的旋转程度。 该流程具体确定页面是顺时针还是逆时针旋转了 0、90、180 和 270 度。 这些信息对于准确呈现或处理文档至关重要,可确保页面以正确的方向显示或打印。

as-heading:2(快速入门:使用 DetectPageOrientation 识别页面旋转)</em

在这个快速示例中,开发人员在加载的 PDF 上使用 IronOCR 的 DetectPageOrientation,并立即访问最有信心的页面的 RotationAngle。 这是一种快速检测和纠正页面旋转的方法,只需最少的设置和代码。

Nuget IconGet started making PDFs with NuGet now:

  1. Install IronOCR with NuGet Package Manager

    PM > Install-Package IronOcr

  2. Copy and run this code snippet.

    var rotationResults = new IronOcr.OcrInput().LoadPdf("doc.pdf").DetectPageOrientation();
    Console.WriteLine(rotationResults.First().RotationAngle);
  3. Deploy to test on your live environment

    Start using IronOCR in your project today with a free trial
    arrow pointer

检测页面旋转示例

请注意This function performs well when the document is text dense.