Print Page | Close Window

How to draw mirrored page

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=2591
Printed Date: 03 Feb 26 at 11:35AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: How to draw mirrored page
Posted By: Proset
Subject: How to draw mirrored page
Date Posted: 05 Apr 13 at 3:28PM
Is it possible  to draw mirrored page with DrawCapturedPage or some other method?
I'm can draw images by use imagematrix function, but could it possible with captured page?





Replies:
Posted By: Ingo
Date Posted: 05 Apr 13 at 7:54PM
Hi!

QuickPDF offers the rotate functionality...
If this won't feed your needs only personal maths/calculations will bring you success i fear ;-)

Cheers, Ingo


Posted By: Proset
Date Posted: 06 Apr 13 at 7:14AM
Hi Ingo
So I'm made one sample pdf & then mirror it by Quite plugin.
Then I'm examine content with RUPS utility
So in mirrored file I'm found an additional stream placed before main stream with data
It contents:
-1 0 0 1 144.57 0 cm
This is a transfomation matrix.
So could you give me some guidelines how I'm can place this matrix in my PDF content with QP library functions?
Best regards
Serge




Posted By: Ingo
Date Posted: 06 Apr 13 at 4:57PM
Hi!

Like i've told:
You have to do it by your own and with your own calculations.
QP won't support it directly.
Have a look in the developer guide and the reference to see what's possible and what not.

Cheers, Ingo


Posted By: Proset
Date Posted: 09 Apr 13 at 6:12AM
So I'm trying this sequence:

int Result=qp.NewContentStream();
qp.SetContentStreamFromVariant(BytesMessage1);
qp.MoveContentStream(Result, 1);

Where "ByteMessage1" is a converted string with transformation matrix(I'm mentioned above)

For my simple file it works quite well.




Posted By: AndrewC
Date Posted: 10 Apr 13 at 8:33AM
Here is some interesting code you might enjoy

            QP.LoadFromFile("testdebenu (1).pdf", "");
            QP.DeletePages(2, 99999);   // Make sure we only have 1 page

            QP.SetOrigin(1);
            double pw = QP.PageWidth() / 2;
            double ph = QP.PageHeight() / 2;

            QP.NewPage();
            int capId = QP.CapturePage(1);

            QP.SelectPage(1);

            QP.DrawCapturedPage(capId, pw, ph, pw, ph);
            QP.DrawCapturedPage(capId, pw, ph, -pw, ph);
            QP.DrawCapturedPage(capId, pw, ph, pw, -ph);
            QP.DrawCapturedPage(capId, pw, ph, -pw, -ph);

            QP.SaveToFile("out.pdf");

If you need to use a negative width or height then you need to adjust you x, y position accordingly.

Andrew.


Posted By: Proset
Date Posted: 10 Apr 13 at 2:07PM
Thank you Andrew

Your's example much more simple & clear.

So negative width is a horizontal mirror & negative height is vertical mirror.
Adjusting x,y I'm can draw copies in required places.

Serge







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