Hi,

Here I am trying to add text with transformation matrix.

PdfMemDocument mDoc;
       PdfPainter *pdfPainter = new PdfPainter();;
       PdfPage *pdfPage;

       mDoc.Load("..\\..\\..\\input\\10 pages.pdf");

       pdfPage = mDoc.GetPage(0);
       PdfRect pageRect = pdfPage->GetMediaBox();
       double pLeft = pageRect.GetLeft();
       double pBottom = pageRect.GetBottom();
       double pWidth = pageRect.GetWidth();
       double pHeight = pageRect.GetHeight();
       printf("\nPage Left: %d", pLeft);
       printf("\nPage Bottom: %d", pBottom);
       printf("\nPage Width: %d", pWidth);
       printf("\nPage Height: %d", pHeight);

       pdfPage = mDoc.GetPage(0);
       pdfPainter->SetPage(pdfPage);

       //Font Style
       //Embedding font with pdf document
       pdfPainter->SetFont(mDoc.CreateFont("Times New Roman"));

       //Font Size
       pdfPainter->GetFont()->SetFontSize(8);

       //Font Color
       pdfPainter->SetColor(0,0,0);

       //Opacity
       PdfExtGState trans(&mDoc);
       trans.SetFillOpacity( 1 );
       pdfPainter->SetExtGState(&trans);

       pLeft = pLeft + 250;
       pBottom = pBottom + 380;
       pWidth = 50;
       pHeight = 100;

       pdfPainter->DrawRect(pLeft, pBottom, pWidth, pHeight);
       pdfPainter->FillRect(pLeft, pBottom, pWidth, pHeight);
       pdfPainter->SetColor(1,0,0);

       pdfPainter->DrawText(pLeft, pBottom, "Dineshkumar");

       double dx = pLeft;
       double dy = pBottom;

       double a, b, c, d, e, f;
       double alpha = 90;
       a = cos(alpha);
b = sin(alpha);
       c = -sin(alpha);
       d = cos(alpha);

       pdfPainter->SetTransformationMatrix(a, b, c, d, 0, 0);
       pdfPainter->Save();

       pdfPainter->DrawText(100, 100, "Sample Text");

       pdfPainter->FinishPage();

       mDoc.Write("Collar_Out.pdf");

But it's not working as expected. Please share the sample code to achieve the 
text rotation by pdfpainter.

Thanks,
Dinesh


::DISCLAIMER::
----------------------------------------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information 
could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in 
transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on 
the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the 
author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction, 
dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written 
consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please 
delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and 
other defects.

----------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to