Print Page | Close Window

Not support Chinese and CMYK Color porblem

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2686
Printed Date: 22 Nov 24 at 12:58PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Not support Chinese and CMYK Color porblem
Posted By: mitchellhu
Subject: Not support Chinese and CMYK Color porblem
Date Posted: 11 Jul 13 at 8:48AM
I download trail version 0914.
found 2 problems.
1. not support Chinese for function DrawText.
2. for function SetFillColorCMYK, 
    QP.SetFillColorCMYK(100,0,0,0) and QP.SetFillColorCMYK(50,0,0,0)
    shows no different , it looks same on pdf.

Is it right, trail version does not support full function?

Mitchell Hu





Replies:
Posted By: Ingo
Date Posted: 11 Jul 13 at 9:07AM
Hi Mitchell!
 
The trial version is only limited in time - not in functionality.
For your problem you should use the search function here
'cause there were similar posts in the past.
 
Cheers and welcome here,
Ingo
 


Posted By: mitchellhu
Date Posted: 11 Jul 13 at 10:11AM
Hi Ingo:

  Thanks for your answer.
  I set CMYK or Chinese as key work , then use Search function , but found not thing!

Mitchell Hu


Posted By: Ingo
Date Posted: 11 Jul 13 at 10:25AM
Do the Advanced search and change time settings.
charset ... japanese ... japanese support ... unicode ... codepage ...
spread your mind ;-)
Using chinese font it's not enough simply using the drawing functions.
You have to add your font for example.
 
 


Posted By: mitchellhu
Date Posted: 11 Jul 13 at 3:33PM
Hi Ingo:
  Just do the Advanced search, found some answer and bring more question !!! Ha! Ha!
 1.AddSubsettedFont function can show Chinse words, but the function parameters squences is different Delphi and
   Debenu Quick PDF library 9.14 Referece Guide.pdf,
   Delphi xe2 : FontName:system.widestring
                SubSetChars:system.WideString
Options:System.Integer
   Referce Guide : AddSubsettedFont(FontName: WideString;
                                    CharsetIndex: Integer; 
SubsetChars: WideString): Integer;
   the other strnage thing is no matter how to chnage FontName ( same as the name in C:\Windows\Fonts\), the Chinese
   Word font only shows default font : '新細明體 標準' and the font id always same as 1476395012. 
   Why?
   Code:
   //ifontID2 := QP.AddTrueTypeSubsettedFont('新細明體 標準', '胡明元', 7); 
   //ifontID2 := QP.AddTrueTypeSubsettedFont('MS Gothic', '胡明元', 7);
   //ifontID2 := QP.AddTrueTypeSubsettedFont('微軟正黑體', '胡明元', 7);
   ifontID2 := QP.AddTrueTypeSubsettedFont('胡明元', 7);
   //CharsetIndex 7: Chinese Big 5
   if (QP.SelectFont(ifontID2) = 1) then
   begin
     QP.SetTextColorCMYK(100, 0, 0, 0);
     QP.SetTextSize(24);
     QP.DrawText(30, 30, '胡明元');
   end;   
  2.about CMYK color question, still found nothing!!!
   QP.SetFillColorCMYK(100,0,0,0) ===> Blue
   QP.SetFillColorCMYK(50,0,0,0) ===> Light Blue
   But the second one will show Blue color same as first one!
   Why?
   Code:
   QP.SetFillColorCMYK(100,0,0,0)
   QP.DrawBox( 10, 10, 10, 5, 2);
   QP.SetFillColorCMYK(50,0,0,0)
   QP.DrawBox( 30, 10, 10, 5, 2);
  3. I want to DrawText(10,10,'CMYK')
     letter 'C' set color to CMYK(100,0,0,0);
     letter 'M' set color to CMYK(0,100,0,0); 
     letter 'Y' set color to CMYK(0,0,100,0);  
     letter 'K' set color to CMYK(0,0,0,100);
    is there a function can extact a letter form text and set it's color?

 Thanks

Mitchell Hu
P.S: My English ability is poor, hope you could understand what I am say 


Posted By: mitchellhu
Date Posted: 12 Jul 13 at 2:40AM
for the point 2. I got answer:
the value for CMYK should be divided by 100.
QP.SetFillColorCMYK(100/100,0,0,0) ===> Blue
QP.SetFillColorCMYK(50/100,0,0,0) ===> Light Blue


Mitchell Hu


Posted By: mitchellhu
Date Posted: 12 Jul 13 at 4:02AM
the 3 point:
use function TDebenuPDFLibrary0914.GetTextWidth(Text: WideString): Double
code
  ifontID2 := QP.AddTrueTypeSubsettedFont('標楷體 標準','胡明元', 7);
  if (QP.SelectFont(ifontID2) = 1) then
  begin
      QP.SetTextColorCMYK(100, 0, 0, 0);
      QP.SetTextSize(48);
      QP.DrawText(30, 30, '胡明元');
      QP.SetTextColorCMYK(100, 0, 0, 0);
      QP.SetTextSize(48);
      QP.DrawText(100, 30, '胡明元');
      QP.SetTextColorCMYK(0, 100, 0, 0);
      QP.DrawText(100+QP.GetTextWidth('胡明元'),30,'胡');
      QP.SetTextColorCMYK(0, 0, 100, 0);
      QP.DrawText(100+QP.GetTextWidth('胡明元胡'),30,'明');
      QP.SetTextColorCMYK(0, 0, 0, 100);
      QP.DrawText(100+QP.GetTextWidth('胡明元胡明'),30,'元');
   end;
  https://skydrive.live.com/?cid=60135ef73eb75601&id=60135EF73EB75601%2123344&action=Share" rel="nofollow - https://skydrive.live.com/?cid=60135ef73eb75601&id=60135EF73EB75601%2123344&action=Share




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk