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

Notification

Icon
Error

New Topic Post Reply
Options
Go to last post Go to first unread
kneecapz  
#1 Posted : Tuesday, December 8, 2020 2:07:11 PM(UTC)
Quote
kneecapz

Rank: Newbie

Groups: Registered
Joined: 12/8/2020(UTC)
Posts: 1
United Kingdom

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);
Paul Rayman  
#2 Posted : Monday, December 14, 2020 7:32:47 PM(UTC)
Quote
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 963

Thanks: 3 times
Was thanked: 115 time(s) in 112 post(s)
Quick Reply Show Quick Reply
Users browsing this topic
New Topic Post Reply
Forum Jump  
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.