Print Page | Close Window

DrawText as black only

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=2975
Printed Date: 18 Jan 26 at 9:35AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: DrawText as black only
Posted By: erico
Subject: DrawText as black only
Date Posted: 24 Sep 14 at 8:07PM
I am manipulating gray scale PDF, but when I add text, they become CMYk. How can I add text and retain "no color"? I only see SetTextColor for rgb and SetTextColorCMYK for 4 color.



Replies:
Posted By: AndrewC
Date Posted: 25 Sep 14 at 12:01PM
Erico,

 
Calling QP.SetTextMode(3) will allow you to draw "invisible" text.

Andrew.


Posted By: erico
Date Posted: 25 Sep 14 at 2:54PM
I don't want invisible text. Perhaps I worded my erquest incorrectly. I want "black" only, so wen I pass my output through color separation, I do not have C-M-Y components, only K.


Posted By: Ingo
Date Posted: 26 Sep 14 at 12:26PM
Hi Erico,
 
but SetTextColor(0, 0, 0) will be black - that's what you want?
 
Cheers and welcome here,
Ingo
 


-------------
Cheers,
Ingo



Posted By: erico
Date Posted: 07 Oct 14 at 3:38PM
Thanks Ingo and Andrew for taking the time to respond. You steered me in the right direction.
I've now solved my problem. It appears changing pages resets the text color to a default 0/0/0 RGB black, which is not the same as 0/0/0/1 CMYK black for color separation purposes.

This does not work:

SetTextColorCMYK(0,0,0,1)
for each(Page in myDocument)
{
  SelectPage(page)
  DrawText(x,y,"sting")
}

This does:
for each(Page in myDocument)
{
  SelectPage(page)
  SetTextColorCMYK(0,0,0,1)
  DrawText(x,y,"string")
}


Posted By: AndrewC
Date Posted: 08 Oct 14 at 10:49AM
Erico,

When you call QP.SelectPage then we have no idea what the current defaults are for the new page so you need to call the drawing functions to select pens, linewidth, fonts, NormalizePage, SetPageSize, colours etc.

Andrew.



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