ByteScout PDF Extractor SDK - C# - Detect Lines - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout PDF Extractor SDK – C# – Detect Lines

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Extractor SDK – C# – Detect Lines

ByteScout PDF Extractor SDK – C# – Detect Lines

Program.cs

using System;
using Bytescout.PDFExtractor;

namespace DetectLines
{
class Program
{
static void Main(string[] args)
{
// Create Bytescout.PDFExtractor.LineDetector instance
LineDetector lineDetector = new LineDetector();
lineDetector.RegistrationName = “demo”;
lineDetector.RegistrationKey = “demo”;

// Load sample PDF document
lineDetector.LoadDocumentFromFile(@”.\sample2.pdf”);

FoundLinesCollection foundLines = lineDetector.FindLines(1, LineOrientationsToFind.HorizontalAndVertical);

Console.WriteLine(“Number of lines found: ” + foundLines.Count);

for (int i = 0; i < foundLines.Count; i++) { FoundLine line = foundLines[i]; Console.WriteLine("Line # " + i); // Line Orientation Console.WriteLine("LineOrientation: " + line.LineOrientation); // Starting point of the line Console.WriteLine("From point: " + line.From); // Ending point of the line Console.WriteLine("To point: " + line.To); // Line width Console.WriteLine("Width: " + line.Width); } Console.ReadLine(); } } } [/csharp]


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next