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
 PdfViewer.LoadFromFile(WideString)
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

aleatprog

132 Posts

Posted - Sep 04 2024 :  07:10:11  Show Profile  Reply
Hi,

is there a way to load with ImageEnView.PdfViewer.LoadFromFile() files with a path length > 255?

Ale

xequte

38590 Posts

Posted - Sep 04 2024 :  16:14:48  Show Profile  Reply
Hi Ale

Well, I think the real issue is that Windows controls will not load a file with a path > 255 characters. The workaround would be to use the short form version of the filename. See the Windows function, GetShortPathName.

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

aleatprog

132 Posts

Posted - Sep 05 2024 :  08:45:37  Show Profile  Reply
Hi Nigel,

thank you for the hint. The ExtendedPrefix (\\?\) removes the MAX_PATH restriction. The following code works fine to me:

ImageEnView.PdfViewer.LoadFromFile(VerifyPath(Path));

function TfMain.VerifyPath(Path: String): String;
begin
  if NOT Path.StartsWith('\\') AND (Length(Path) > 255) then
    Result := '\\?\' + Path;
end;


Ale
Go to Top of Page

xequte

38590 Posts

Posted - Sep 05 2024 :  16:21:39  Show Profile  Reply
Thanks for letting us know, Ale

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