Dear Sir / Madam,

        PdfMemDocument  doc("D:\\sample pdf\\test.pdf");
        PdfPainter              painter;
        PdfPage*                pPage;
        PdfRect         rect;
        PdfFont*                pFont = doc.CreateFont("Arial Unicode MS", 
false, new PdfIdentityEncoding(0, 0xffff, true));
        PdfString               text; 

        pFont->SetFontSize(72);
 
        for (int i = 0; i < doc.GetPageCount(); i++)
        {
                pPage = doc.GetPage(i); 
                rect = pPage->GetPageSize();
                painter.SetPage(pPage);
                painter.SetFont(pFont); 
                painter.SetColor(PdfColor(1.0, 0, 0)); 
                PdfExtGState gstate(&doc);
                gstate.SetFillOpacity(0.5);
                gstate.SetStrokeOpacity(0.5);
                painter.SetExtGState(&gstate);
                painter.SetColor(PdfColor(1.0, 0, 0));
                text = "line 1";
                painter.DrawText(pPage->GetPageSize().GetWidth() - 200, 
pPage->GetPageSize().GetHeight() - 25, text);
                text = "line 2";
                painter.DrawText(pPage->GetPageSize().GetWidth() - 200, 
pPage->GetPageSize().GetHeight() - 40, text);
                painter.SetStrokingColor(1.0, 0.0, 0.0);
                painter.SetStrokeWidth(2);
                painter.SetExtGState(&gstate);
                painter.Rectangle(rect.GetWidth() - 205, rect.GetHeight() 
- 55, 200, 50, 2, 2);
                painter.Stroke();
                painter.SetTransformationMatrix(1, 0, 0, 1, 
rect.GetWidth() / 2, rect.GetHeight() / 2);
                painter.SetTransformationMatrix(0.707, 0.707, -0.707, 
0.707, 0, 0);
                text = L"こんにちは";
                painter.DrawText(0, 0, text);
                painter.FinishPage();
        } 

        doc.Write("D:\\sample pdf\\testmazak2.pdf");


1) how to add non-english text watermark 

if 
PdfFont*                pFont = doc.CreateFont("Arial Unicode MS", false, 
new PdfIdentityEncoding(0, 0xffff, true));
has run time error 

"Unhandled exception at 0x77C6291F (ntdll.dll) in PDF.exe: 0xC0000005: 
Access violation reading location 0x02577AE3."


if 
PdfFont*                pFont = doc.CreateFont("Arial Unicode MS", false, 
new PdfIdentityEncoding(0, 0xffff, false));
no error but the pdf before watermark is 39KB, after watermark become 
14,998KB


2) in portrait page, watermark display ok, but in landscape, watermark 
display not right



3) how to increase font size because already set to 72 but display still 
not correct size

please advice.


thanks you.

with regards,
tang


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to