ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Access to *.pdf was denied
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

aleatprog

135 Posts

Posted - Nov 26 2024 :  14:11:13  Show Profile  Reply
Hi,

the following IEVision code (executed in a Windows Service application) creates a non empty but inaccessable PDF file with empty security properties:

mBmp := TIEMultiBitmap.create(SourcePath);
mBmp.CreateSearchablePDF(DestinationPath, 'PDF title', OCR_English_Language, ievOCRAuto, ievPDFImgFmt_AUTO, TessDataPath);
mBmp.Free;


Trying to open this PDF file causes the error message "Access to *.pdf was denied".
Does anybody got an idea why the created PDF file is inaccessable?

Ale

xequte

38684 Posts

Posted - Nov 26 2024 :  23:28:56  Show Profile  Reply
Hi Ale

I'm not seeing that here with a regular VCL application. What version of ImageEn, IEVision and Delphi are you using?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

aleatprog

135 Posts

Posted - Nov 27 2024 :  05:05:56  Show Profile  Reply
Hi Nigel,

I'm using:

  • ImageEn v13.6.0
  • IEVision v8.1.4
  • Delphi 12.2 Patch 1 (v29.0.53571.9782)

Executing the code inside a VCL works correctly. How may I use it inside a Windows Service thread?

Ale
Go to Top of Page

xequte

38684 Posts

Posted - Nov 27 2024 :  14:22:22  Show Profile  Reply
Hi Ale

I'm sorry, but I have no experience with Windows Services. Try and narrow down the issue (e.g. make it happen with just a standard TFileStream). That may give some direction.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

aleatprog

135 Posts

Posted - Nov 28 2024 :  04:46:25  Show Profile  Reply
Hi Nigel,

following my tests, the PDF file becomes accessable if the Windows service is executed by a Windows account and not the local system (standard setting). Probably, the PDF file produced by IEVision inherits the security rights from the service executor.
This would also explain why the helper method CreateSearchablePDF works correctly in VCLs executed by Windows users.

For network security issues, I prefer running a Windows service by the local system, thus I should find an alternative way to let IEVision create accessable PDF files with valid security settings. Unfortunately, also TIEVisionSearchablePDFGenerator creates inaccessable PDF files. Do you have any other alternative code examples for creating searchable PDF files with IEVision?

Ale
Go to Top of Page

xequte

38684 Posts

Posted - Nov 28 2024 :  21:47:27  Show Profile  Reply
Hi Ale

Unfortunately, in that case I think you will have the same problem no matter what method you use to create the PDF.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: