PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed Feb 05, 2025 6:01 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Dec 30, 2024 8:37 pm 
Offline

Joined: Tue Dec 17, 2024 11:56 pm
Posts: 8
I've got a PDF file that was OCR'd by Mobi PDF. I double-checked the OCR by closing Mobi PDF, re-opening the file, selecting a phrase, and then copy/pasting that phrase into NotePad and it's correct, so the OCR is good.

The challenge is, I'd now like to look at the output of the OCR using PdfSharp, but I can't find the text anywhere. All I can see is that in the contents of the page by calling
Code:
 ContentReader.ReadContent(Page);
, there is a Dictionary operator "/Part <</MCID 0 >>".

I've been reading up on marked-content identifiers but it's all new to me and I can't figure out how to find the content that the MCID is referring to.

How can I find the actual content in the PDF file? Or am I barking up the wrong tree, is the OCR text actually stored somewhere completely different?

Thanks,
Chris


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 06, 2025 8:37 am 
Offline
PDFsharp Guru
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 1028
Location: CCAA
Hi!
cshearercooper wrote:
there is a Dictionary operator "/Part <</MCID 0 >>".
Without context, I cannot say what it is.

The commands that draw the text may use glyph indexes, as in "<002B0048004F004F0052000F0003003A00520055004F00470004> Tj".
See also: https://docs.pdfsharp.net/PDFsharp/Topi ... pping.html

There may be a table that maps glyph indexes to Unicode. Without that table, you cannot decode the text.
For an OCRed file, this table should be present.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group