Skip to content
This repository has been archived by the owner on Aug 2, 2019. It is now read-only.

how can i get words locations (x, y coordinates)? #194

Open
DenisSouth opened this issue Apr 23, 2019 · 0 comments
Open

how can i get words locations (x, y coordinates)? #194

DenisSouth opened this issue Apr 23, 2019 · 0 comments

Comments

@DenisSouth
Copy link

I can extract text like this. but I want to get locations of each phrase

public static string get_text(string PDFFilePath) {
string feed = "";
using(var document = PdfiumViewer.PdfDocument.Load(PDFFilePath))
{
var dpi = 300;
using(var image = document.Render(0, dpi, dpi, PdfRenderFlags.CorrectFromDpi)) {
feed = feed + document.GetPdfText(0) + "\n";
var encoder = ImageCodecInfo.GetImageEncoders().First(c => c.FormatID == ImageFormat.Jpeg.Guid);
var encParams = new EncoderParameters(1);
encParams.Param[0] = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 100 L);
}
}
return feed;
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant