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 - Problems adding text to a existing PDF file
  FAQ FAQ  Forum Search   Register Register  Login Login

Problems adding text to a existing PDF file

 Post Reply Post Reply
Author
Message
Tharos View Drop Down
Beginner
Beginner


Joined: 28 Dec 10
Status: Offline
Points: 16
Post Options Post Options   Thanks (1) Thanks(1)   Quote Tharos Quote  Post ReplyReply Direct Link To This Post Topic: Problems adding text to a existing PDF file
    Posted: 05 Jan 11 at 9:06AM
Hii everyone:

I have other problem with my pdfs. I´m adding a Watermark in PDF like this:

 for (int i = 1; i <= paginas; i++)
 {
      try
    {
                  QP.SelectPage(i);

                   int capa1=QP.NewLayer();
                    QP.SetTextSize(20);
                    QP.SetTextColor(255, 0, 0);
                    QP.SetTransparency(50);
                    QP.DrawRotatedText(80,250,45,"Distribución Limitada");
                     int OC1 = QP.NewOptionalContentGroup("Conf");
                     QP.SetLayerOptional(OC1);
                     QP.MoveLayer(descriptor, 1);
                     QP.SetOptionalContentGroupVisible(OC1, 0);
                      QP.SetOptionalContentGroupPrintable(OC1, 1);
    }

After this treatment, I have my pdfs with watermark but, in some pdf file the text is correct and in ohters files the text is flipped, as a mirror of the original text.

For Example:


Image with the text CORRECT:




Image with the text INCORRECT:




I dont now why the instruction "DrawRotatedText" modifiy this text in some pdf files. I Have done proofs changing position text, angle of rotation.. and nothing!! the image is not correct!!.

Somebody knows a solution?

Thanks!!!!


Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 05 Jan 11 at 9:11AM
Hi!

So the pdf-documents are already rotated before...
At the beginning/before drawing anything anywhere
you should determine where you want to start:
Try SetOrigin
You should read here:
http://www.quickpdflibrary.com/help/quickpdf/MeasurementAndCoordinateUnits.php

Cheers, Ingo

Back to Top
Tharos View Drop Down
Beginner
Beginner


Joined: 28 Dec 10
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tharos Quote  Post ReplyReply Direct Link To This Post Posted: 05 Jan 11 at 9:42AM
thanks for the fast reply. I put the instruction before DrawingText, but only change the position of the text but, it still appear wrong...

Edited by Tharos - 05 Jan 11 at 9:42AM
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 05 Jan 11 at 3:18PM
You have to check directly into the pdf-content (best to read it into a stream or string once) if there's a string "rotate". If it's so then you have to change your watermark.

Cheers, Ingo
Back to Top
Tharos View Drop Down
Beginner
Beginner


Joined: 28 Dec 10
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tharos Quote  Post ReplyReply Direct Link To This Post Posted: 05 Jan 11 at 3:46PM
in my pdf-content?? there are only words and searching in that document, the string or the word "rotate" doesnt exist.

You say that i have to read all the pdf using a stream (for example in VIsual Studio) and find the string rotate?? If searching in that document, I dont found the word it is not necessary to read the document arround a stream, does not?

I dont understand....
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 05 Jan 11 at 5:39PM
Hi!

The REAL content!
Open the pdf with notepad and you'll know what i mean.

Back to Top
Tharos View Drop Down
Beginner
Beginner


Joined: 28 Dec 10
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tharos Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jan 11 at 7:13AM
the word "Rotated" or "Rotate" or any possible similar word does not exist in the document.... whats happened now??

Thanks!
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jan 11 at 7:27AM
Hi!

So you should upload the prob-pdf and a detailed error-description
on the official support forum at www.quickpdflibrary.com

Cheers, Ingo
Back to Top
Tharos View Drop Down
Beginner
Beginner


Joined: 28 Dec 10
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tharos Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jan 11 at 8:25AM
where? I dont find these forum..

Cheers!

PD: here is the pdf that causes problem using the code write in this post.

http://www.host-files.com/i/download.php?file=848Watermark.pdf


Edited by Tharos - 07 Jan 11 at 9:49AM
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jan 11 at 11:54AM
Tharos!
Where?

Here:
www.quickpdflibrary.com
...
then "support"
...
then ...

Cheers, Ingo

Back to Top
Tharos View Drop Down
Beginner
Beginner


Joined: 28 Dec 10
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tharos Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jan 11 at 12:00PM
OK i know but if I go to support and then forum, the page that appear is the index of this forum... what link is??
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jan 11 at 12:05PM
Ok...
I've looked again for you:
http://www.quickpdflibrary.com/support/support-query.php

Back to Top
Tharos View Drop Down
Beginner
Beginner


Joined: 28 Dec 10
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tharos Quote  Post ReplyReply Direct Link To This Post Posted: 07 Jan 11 at 12:19PM
thanks thats works!! I send the problem and now waiting for an answer...

cheers!!!
Back to Top
Dimitry View Drop Down
Team Player
Team Player


Joined: 18 Feb 10
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dimitry Quote  Post ReplyReply Direct Link To This Post Posted: 15 Jan 11 at 10:20PM
Please try to use 
  QP.CombineLayers();
for each page, before adding new text.
Regards,
Dmitry
Back to Top
Jhon View Drop Down
Beginner
Beginner
Avatar

Joined: 10 Oct 10
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jhon Quote  Post ReplyReply Direct Link To This Post Posted: 02 Feb 11 at 1:20PM
Hi:
i have same problems, even you use SetOrigin, the Origin is not same in some pdf files.
if you SetOrigin(0), the Origin is top left in some pdf files, but is bottom left in other pdf files.

i try to use CombineLayers(); but the problem is same.

every one can help me?

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 02 Feb 11 at 2:00PM
Hi!

The keyword could be "rotated" ...
Please read the thread from beginning ;-)
...or upload some samples.

Cheers, Ingo

Back to Top
Dimitry View Drop Down
Team Player
Team Player


Joined: 18 Feb 10
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dimitry Quote  Post ReplyReply Direct Link To This Post Posted: 02 Feb 11 at 3:03PM
Before making changes inside page we should define co-ordinate system using SetOrigin().
Also page can be rotated using RotatePage().
And before applying changes to existing PDF we should obviously check existing rotation for each page using PageRotation().
Regards,
Dmitry
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 13 Jul 14 at 4:47AM
We have added a function called NormalizePage() that should fix all of these types of issues.

If you want to add text or other content to a PDF then you should add a call to QP.NormalizePage(0); after calling QP.SelectPage().


Andrew.
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