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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 PdfViewer.LoadFromFile(WideString)

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
aleatprog Posted - Sep 04 2024 : 07:10:11
Hi,

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

Ale
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Sep 05 2024 : 16:21:39
Thanks for letting us know, Ale

Nigel
Xequte Software
www.imageen.com
aleatprog Posted - Sep 05 2024 : 08:45:37
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
xequte Posted - Sep 04 2024 : 16:14:48
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