Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
File Path |
Post Reply
|
| Author | ||
mingoal
Beginner
Joined: 24 Jan 10 Location: China Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Topic: File PathPosted: 31 Jan 10 at 10:35AM |
|
|
Hello everybody!
I use QuickPDF to generate pdf, but I find that it does not work as I thought when I pass a string contains characters to functions which need a path as parameter, such as AddImageFromFile(), SavetoFile() etc.
For example:
if(m_docQPDF.AddImageFromFile("C:\Documents and Settings\mingoal\桌面\map.bmp",0) != 0)
{
AfxMessageBox("Quick PDF Load Image Failed! ");
}
Can somebody help me to solve this promble ,or give me some hints ?
Thanks in advance !
Mingoal
|
||
![]() |
||
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
Posted: 31 Jan 10 at 1:37PM |
|
|
Hi Mingoal!
The path isn't the problem ... the used characters between "mingoal" and "map" are the problem. You take the path/file-name as a string but in strings you can't work with chinese characters. The newest versions of QuickPDF are changed to work with unicode-characters, too. In delphi something like AddImageFromFile(WideString(Edit1.Text),0) <> 0 could work ... Cheers, Ingo |
||
![]() |
||
mingoal
Beginner
Joined: 24 Jan 10 Location: China Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 01 Feb 10 at 12:46AM |
|
|
Thank you for your reply, I really appreciate it. I will try it again under your help.
Best regards!
mingoal
|
||
![]() |
||
mingoal
Beginner
Joined: 24 Jan 10 Location: China Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 Feb 10 at 12:26PM |
|
|
I checked the API reference again, and I found that Quick PDF supports unicode file name, but I need to encode the file name using UTF8. Thus, I use a small function to convert a CString object to UTF8-encoding string. Here are my c++ sample code:
Sample:
|
||
![]() |
||
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store