Libre Office Draw: OCR text jump to front of image

I am using Libre Office Version: 7.0.1.2
Build ID: 00(Build:2)
CPU threads: 2; OS: Linux 4.15; USample-raster-OCRmypdf-pdf.odfI render: default; VCL: gtk3
Locale: en-IN (en_IN); UI: en-US
Ubuntu package version: 1:7.0.1_rc2-0ubuntu0.18.04.1
Calc: threaded

I noted that whenever I open a pdf file made of scanned image + OCR in Libre Office Draw for editing the last most text on every page is visible above the image. This cause lot of problem if I am working with 100s of pages. I have to select image on every page and move it to front.
Note: I used ocrmypdf to OCR those documents. if it is important.

Edit1.
Here are three files
1st “Sample-raster-OCRmypdf.pdf” is raster pdf containing ocr text after doing ocrmypdf. File link below in Edit3.
2nd “Sample-raster-OCRmypdf.odg” exported resultant file after opening above same file in Libre Office Draw. The last text on page visible to front as soon as i open file “Sample-raster-OCRmypdf.pdf” in Libre Office Draw.Sample-raster-OCRmypdf.odg
3rd file “Sample-raster-OCRmypdf-libreofficedraw.pdf” after exporting from Libre Office Draw. File link below in Edit3.
Thank you.

Edit2.
i converted the raster pdf file with ocr to PDF v. 1.4 using gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4. But still on opening resultant pdf file in Libre Office Draw no change.

Edit3.
Loading .pdf file with fake extension -pdf.odf. please change after downloading file.
"Sample-raster-OCRmypdf.pdf"Sample-raster-OCRmypdf-pdf.odf
"Sample-raster-OCRmypdf-libreofficedraw.pdf"Sample-raster-OCRmypdf-libreofficedraw-pdf.odf

Now I may tell that both above files images were edited with GIMP then exported >> to pdf and then >> OCR.
I scanned this file as pdfScanned-OCR-pdf.odf. did not opened this file in GIMP and created it by directly running OCR. When I opened this file in Libre Office Draw there was no flaw.

I may further tell that I downloaded a scanned pdf file with OCR scanned with Cannon scanner. When I opened that pdf file with Libre Office Draw all the text was at front and image at back. I can not share file link being third party.

So problem is different with different files and softwares.

Hello @AjayX1, Your PDF reader open the file without problem?

Would you share a two pages sample file that show the issue? Click edit below your question to add more information, and use the paper clip to upload the sample file (remove all sensible data before).

Add Answer is reserved for solutions. Thanks.

Can you save the OCR-ed file as PDF in version 1.5 or 1.4? Try it befor opening in Draw, and tell us what happen.

I have to check this option in ocrmypdf. I shall revert. Still I will say it is a bug even if it works in saving PDF in version 1.5 or 1.4.

Okay i converted the raster pdf file with ocr to PDF v. 1.4 using gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4. But still on opening resultant pdf file in Libre Office Draw no change.

@AjayX1, I can confirm the behavior in LibreOffice 6.4.7.2 (x86); OS: Windows 6.1.

You can file a bug. Then share the bug report number here (just type tdf# and the number).

There is a partially related bug reported: tdf#136395.

I’m confused and ask you to help me:

…whenever I open a pdf file made of scanned image + OCR…

This reads as if the pdf was made by scanning a paper and additionally applying OCR by some software I don’t know. The result may be doubtable.
Then you open the file with LibreOffice Draw, and get an unexpected result.
If I should find the reasons or judge what step might have spoilt something, I would need the file resulting from the steps done in advance. Something saved with LibO after the surprise wouldn’t help me much.
Therefore I would expect the questioner to post his mentioned pdf file, and not a screenshot of it.
What did I see wrongly?
Well, .pdf is not accepted for uploads here? Simply append a fake extension like .odt, tell us so, and upload again.

Okay I will post .pdf file adding additional fake extension .odf. Further I am adding response to your query as Edit3 in my question.
Now you will further surprise.

Still trying to understand.

…a scanned pdf file with OCR scanned with Cannon scanner.

I haven’t any Canon scanner to my disposition, and I don’t know what options it would offer.
My own scanner (old hp multi-function photosmart having included a light version of IRIS OCR) offers a scan with the target option “Searchable PDF” which leads to a pdf already processed by the included OCR software, and thus searchable for text content. I often use this option. and the pdf files I get never show an issue of the kind you reported. Just tried again with my scanner, and the pdf I got contained the whole-area image, is searchable in Foxit, and doesn’t show any text shape brought to front when opened with LibO (7.0.3) Draw. Only if I change the Z-order (“arrange” item of the context menu), it is different. I would therefore assume an issue with the Canon device, but opening the pdf you finally attached to your question, I don’t see the issue.
Strange…

Lupp it is not problem related with how OCR achieved. It is problem related with something I don’t know.

Lupp it is not problem related with how OCR achieved.

My problem: How do you know? How is your claim compatible with the facts I reported from my experience with OCRed scans to PDF?

I seriously invite everybody having studied this thread to help me understand.

It is problem related with something I don’t know.

This is a statement we may agree about. I feel the same way.

Lupp I have checked many pdf files(with OCR) downloading from archive.org as files there are scanned and OCRed in variety of ways. In all files any of the text (either whole page or a line or at least last text on each page) appeared at front when opened in LibO (7.0.3) Draw.

I didn’t download any such files from your sources. …
If you feel sure there’s a bug in LibO, you should report it to bugs.documentfoundation.org .

It also occurs in Draw 6.4.7.2 with pdf files output by ABBYY Finereader 9.0 (2008) but they look like original scan in Adobe Reader DC 20.013…

I had never noticed because I edit OCR within ABBYY and never open those pdfs with Draw. The simple solution appears to be select the picture and press Ctrl+Shift++ to bring it to the top

I filed the Bug 138810 on https://bugs.documentfoundation.org