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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - SetTextMode function is not working for me. Why?
  FAQ FAQ  Forum Search   Register Register  Login Login

SetTextMode function is not working for me. Why?

 Post Reply Post Reply
Author
Message
ExchangeViews View Drop Down
Team Player
Team Player
Avatar

Joined: 13 Mar 12
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote ExchangeViews Quote  Post ReplyReply Direct Link To This Post Topic: SetTextMode function is not working for me. Why?
    Posted: 12 May 12 at 9:17AM
Using D2009 and QPL8.15 with following code:
QP.SetMeasurementUnits(1);
QP.SetTextMode(1);
QP.SelectPage(1);
QP.SetOrigin(1);
QP.SetTextSize(25);
QP.DrawRotatedText(TXTH , TXTH, Angle, TXT);

but the output is not showing Outline text. In fact it is also not showing Fill then stroke text. How to use this function for "Fill then stroke text"and how to fill desired color. Any help? Thanks in advance.
Back to Top
ExchangeViews View Drop Down
Team Player
Team Player
Avatar

Joined: 13 Mar 12
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote ExchangeViews Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 12 at 9:28AM
Hi all,
Changing the order of code lines fixed the outline issue as below...but how to set the outline color?
QP.SetMeasurementUnits(1);
QP.SelectPage(1);
QP.SetOrigin(1);
QP.SetTextMode(1);
QP.SetTextSize(25);
QP.DrawRotatedText(TXTH , TXTH, Angle, TXT);

Thanks
Back to Top
edvoigt View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 Mar 11
Location: Berlin, Germany
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote edvoigt Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 12 at 2:06PM
Hi,

no problem. By default textcolor and linecolor is black. You should change them:

  QP.SetTextSize(25);
  QP.SetTextMode(2);            // both: outline and fillcolor
  QP.SetLineColor(0, 0, 0);     // color for outline
  QP.SetLineWidth(0.5);         // thickness of outline
  QP.SetTextColor(0.5, 0.5, 1); // textcolor=fillcolor
 
With SetTextMode(1) you do not need SetTextColor. It's needed for TextMode(2).

Choose LineWidth depending on TextSize and beware for millimeters (LineWidth) and points (TextSize).


Cheers,

Werner
Back to Top
ExchangeViews View Drop Down
Team Player
Team Player
Avatar

Joined: 13 Mar 12
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote ExchangeViews Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 12 at 9:40AM
Thanks a lotClap!!! It is working great.
Now I want to draw text beneath the page content (i.e. in background). Is there any function available?
Back to Top
edvoigt View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 Mar 11
Location: Berlin, Germany
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote edvoigt Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 12 at 9:58AM
Hi,

yes it is.

Because a PDF-Reader is working like an interpreter, the order in which the draw-commands are in the PDF determes who lays on whom, we must draw all Backgroundinfo first and the content later.

So it is rather clear for a new PDF-page. But how to do it on a existing PDF?

In a first step we take the the hole existing content from a existing page and build a new one in same dimensions. This goes over capturepage-functions. On the new page we put first our backgroundstuff and put as second the captured page on it. That's all.

For an example look at: http://www.quickpdf.org/forum/stamping-with-a-rotated-shadowed-text-www-link_topic2081_post8876.html?KW=watermark#8876

There I used an example from Andrew, to bring a watermark under the pagecontent.


Cheers again,

Werner
Back to Top
ExchangeViews View Drop Down
Team Player
Team Player
Avatar

Joined: 13 Mar 12
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote ExchangeViews Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 12 at 10:09AM
Thanks for your prompt reply. Going to implement now...
Back to Top
ExchangeViews View Drop Down
Team Player
Team Player
Avatar

Joined: 13 Mar 12
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote ExchangeViews Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 12 at 12:37PM
Dear Werner, everything is perfect but the output page text is overwritten and not displaying correctly. Any help?
Back to Top
ExchangeViews View Drop Down
Team Player
Team Player
Avatar

Joined: 13 Mar 12
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote ExchangeViews Quote  Post ReplyReply Direct Link To This Post Posted: 15 May 12 at 1:03PM
I figured out the problem, It is when we add watermark with SetTextMode(1 or 2) function. It is creating the outline on the characters of captured page. Any suggestion?
Back to Top
edvoigt View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 Mar 11
Location: Berlin, Germany
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote edvoigt Quote  Post ReplyReply Direct Link To This Post Posted: 21 May 12 at 6:24PM
Hi,

only a remark.

Put around the Watermark-code a SaveState and LoadState, so after this all (I hope) PDF-options like Colors, Sizes, Textmode ... are in the State as before SaveState and will no more disturb drawing the captured page.

SaveState;
Watermark;
LoadState;       // as it was
DrawCaptured;

This solution is ever a help, if you have to mix something.

In your case, SetTextMode(0) before Drawcaptured would be enough, but if you change the watermark-drawing, it may get other bad influence to the captured page.

Cheers,

Werner
Back to Top
ExchangeViews View Drop Down
Team Player
Team Player
Avatar

Joined: 13 Mar 12
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote ExchangeViews Quote  Post ReplyReply Direct Link To This Post Posted: 22 May 12 at 9:47AM
Thanks. But if I use QP.NormalizePage(0) for rotated pages, It is showing just a blank page.

NormalizePage
SaveState;
Watermark;
LoadState;       // as it was
DrawCaptured;
Back to Top
edvoigt View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 Mar 11
Location: Berlin, Germany
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote edvoigt Quote  Post ReplyReply Direct Link To This Post Posted: 22 May 12 at 10:05AM
Hi,

to understand what happens, ask the QPL for the Rotation inside your PDF before and after NormalizePage.

Description
Moves and/or rotates the contents of the page so that subsequent drawing operations are at the
expected position on the page. All the page boundary boxes are adjusted to the physical size of the page and the page's rotation attribute is reset to zero.

I believe, you make after NormalizePage your Rotation with the before calculated angle and put so the pagecontent outside the visible area.


Cheers,

Werner
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store