logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Post a reply
From:
Message:

Maximum number of characters in each post is: 32767
Bold Italic Underline   Highlight Quote Choose Language for Syntax Highlighting Insert Image Insert an existing Attachment or upload a new File... Create Link   Unordered List Ordered List   Left Justify Center Justify Right Justify   Outdent Indent   More BBCode Tags
Font Color Font Size
Security Image:
Enter The Letters From The Security Image:
  Preview Post Cancel

Last 10 Posts (In reverse order)
Paul Rayman Posted: Monday, December 14, 2020 4:32:47 PM(UTC)
 
kneecapz Posted: Tuesday, December 8, 2020 11:07:11 AM(UTC)
 
Hi,

I can't get PdfPage.Render() to render a portion of page. I am trying to do it with matrix manipulation, but it's just not happening. In fact, whatever numbers or methods I try, the page is always rendered in full. Can someone explain how to correctly use FS_Matrix.Scale(), PdfPage.TransformWithClip() etc?

Here's one of the attempts in code (tried many other versions with different values anywhere and everywhere, different methods, etc):

Code:
            FS_RECTF rr = new FS_RECTF(0f, 0f, 1000f, 1000f);
            FS_MATRIX mm = new FS_MATRIX(0.5f, 0, 0, 0.5f, 0, 0);
            mm.Scale(.5f, .5f);
            pdfPage.TransformWithClip(mm, rr);

            pdfWidth = (int)pdfPage.Width;
            pdfHeight = (int)pdfPage.Height;
            pdfBmp = new PdfBitmap(pdfWidth, pdfHeight, false);
            pdfBmp.FillRect(0, 0, pdfWidth, pdfHeight, FS_COLOR.White);
            pdfPage.Render(pdfBmp, 0, 0, pdfWidth, pdfHeight, Patagames.Pdf.Enums.PageRotate.Normal, Patagames.Pdf.Enums.RenderFlags.FPDF_NONE);