Issue 849 in pdfium: FPDF_RenderPageBitmapWithMatrix() still not behaving properly

475 views
Skip to first unread message

andr… via monorail

unread,
Aug 1, 2017, 7:26:16 AM8/1/17
to pdfiu...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849

Even with last week's fix for #837 FPDF_RenderPageBitmapWithMatrix() still doesn't seem to behave properly. For example, I have a test PDF for which FPDF_GetPageWidth()/Height() returns 595x841 pixels. When rendering this PDF with the following code...

FS_RECTF rc;
FS_MATRIX transform;
int width = (int) FPDF_GetPageWidth(page);
int height = (int) FPDF_GetPageHeight(page);

// scale down by 50%
transform.a = 0.5;
transform.b = 0;
transform.c = 0;
transform.d = 0.5;
transform.e = 0;
transform.f = 0;

rc.left = 0;
rc.top = 0;
rc.right = (float) (width>>1);
rc.bottom = (float) (height>>1);

FPDF_RenderPageBitmapWithMatrix(bm, page, &transform, &rc, 0);

...FPDF_RenderPageBitmapWithMatrix() only draws 149x210 pixels. So it seems to be scaled down to 25% of its original size. The transformation matrix, however, dictates scaling down to 50% of the original size. So I'd expect PDFium to draw
297x420 pixels instead.


--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

rharri… via monorail

unread,
Aug 1, 2017, 11:00:41 AM8/1/17
to pdfiu...@googlegroups.com
Updates:
Owner: n...@chromium.org
Status: Accepted

Comment #1 on issue 849 by rhar...@chromium.org: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c1

(No comment was entered for this change.)

n… via monorail

unread,
Aug 3, 2017, 4:39:10 PM8/3/17
to pdfiu...@googlegroups.com
Updates:
Status: WontFix

Comment #2 on issue 849 by n...@chromium.org: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c2

You shouldn't be dividing the rc.right and rc.bottom variables by 2. Notice that you'll get half the size if you do that (divide width and height by 2) even when using FPDF_RenderPageBitmap because you're essentially telling the method that that's all the space you got. So the fact that you get one quarter of the size when doing that in addition to using the transformation matrix makes sense here.

andr… via monorail

unread,
Aug 8, 2017, 2:53:18 PM8/8/17
to pdfiu...@googlegroups.com

Comment #3 on issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c3

Ok when passing (width,height) instead of (width/2,height/2) in the clipping rectangle the page is drawn correctly but only when downscaling the page. When upscaling the page, the page is cut off on the bottom and the right and there is just whitespace. Here is the code:


FS_RECTF rc;
FS_MATRIX transform;
int width = (int) FPDF_GetPageWidth(page);
int height = (int) FPDF_GetPageHeight(page);

// scale up by 110%
transform.a = 1.1;

transform.b = 0;
transform.c = 0;
transform.d = 1.1;

transform.e = 0;
transform.f = 0;

rc.left = 0;
rc.top = 0;
rc.right = (float) width;
rc.bottom = (float) height;


FPDF_RenderPageBitmapWithMatrix(bm, page, &transform, &rc, 0);

This leaves whitespace on the right and the bottom of the destination bitmap although the destination bitmap has been allocated in the size of (width*1.1,height*1.1). Why? Is this a bug or am I doing something wrong?

n… via monorail

unread,
Aug 8, 2017, 4:01:29 PM8/8/17
to pdfiu...@googlegroups.com
Updates:
Cc: the...@chromium.org

Comment #4 on issue 849 by n...@chromium.org: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c4

Oh I see what you mean. If you just want to render the same thing as the original but in a larger bitmap (so, change the scale), you can do it by multiplying the width and height by the scale (1.1 in your example), and using FPDF_RenderPageBitmap as usual.

I actually don't know the exact purpose of FPDF_RenderPageBitmapWithMatrix. But it seems to transform what you see (so downscaling will produce whitespace and upscaling will cut a portion of the page). I'm not sure if this is intended, thestig@?

andr… via monorail

unread,
Aug 8, 2017, 4:06:39 PM8/8/17
to pdfiu...@googlegroups.com

Comment #5 on issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c5


>so downscaling will produce whitespace and upscaling
>will cut a portion of the page

No, downscaling actually works but upscaling cuts off the page and produces whitespace.


>I actually don't know the exact purpose of FPDF_RenderPageBitmapWithMatrix

FPDF_RenderPageBitmapWithMatrix() is really useful for example to rotate a page or even to scale and rotate a page at the same time. But I still find it weird that the clipping rectangle seems to be in page coordinate space, not in the space of available pixels in the destination bitmap.

>If you just want to render the same thing as the original but in a larger bitmap

That won't solve all my needs because I may also need to rotate and scale at the same time so I'd really need FPDF_RenderPageBitmapWithMatrix() to behave properly.

n… via monorail

unread,
Aug 8, 2017, 4:42:42 PM8/8/17
to pdfiu...@googlegroups.com

Comment #6 on issue 849 by n...@chromium.org: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c6

I don't understand what you mean. Downscaling and upscaling are working the same way: take the page, transform it, and put it in a bitmap of the same original size. So downscaling will produce whitespace simply because the page image shrinked but the bitmap stays the same size. Upscaling will cut the page because it won't fit the bitmap, but it shouldn't produce any whitespace. Obviously, if you call the method on a bitmap of size width*1.1, but with parameter=width instead, then parts of the resulting bitmap will be untouched because you lied about the size of your bitmap (maybe that is why you think it is producing whitespace). In your example, is the size of the bitmap width * height, or is it (1.1 width) * (1.1 height)?

Again, if what you're trying to do is scale instead of transform, just change the width and height from the very beginning (also works with FPDF_RenderPageBitmapWithMatrix if you need to do other operations to it).

If you still think you're getting whitespace on upscaling, please attach the PDF because and include the bitmap creation code so I can try to reproduce.

andr… via monorail

unread,
Aug 9, 2017, 9:13:38 AM8/9/17
to pdfiu...@googlegroups.com

Comment #7 on issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c7

I've now prepared a little demo program for you. With this the issue should become clear to you immediately. The problem can be seen with any PDF.

Just start the demo program like this:

# test downscaling
$ ./a.out test.pdf 0.5

# test upscaling
$ ./a.out test.pdf 1.5

The test program will write a BMP picture named "page.bmp" to the current directory. You'll see that downscaling works fine but with upscaling there is whitespace. I've also tried to set the clipping rectangle to the bitmap's dimensions instead of the page's dimensions but then there is whitespace when downscaling and the page is cut off when upscaling. See these remarks by me in the code:

#if 0
// when using this code there is whitespace when downscaling and
// parts of the page are cut off when upscaling
rc.right = (float) bwidth;
rc.bottom = (float) bheight;
#else
// when using this code downscaling works fine but there is whitespace
// when upscaling
rc.right = (float) pwidth;
rc.bottom = (float) pheight;
#endif

Am I doing something wrong here or is this a bug?


Attachments:
test.c 3.7 KB

n… via monorail

unread,
Aug 9, 2017, 4:34:26 PM8/9/17
to pdfiu...@googlegroups.com
Updates:
Status:

Comment #8 on issue 849 by n...@chromium.org: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c8

Try using the option under '#if 0 ' with transform.a and transform.d set to 1 instead of scale.

I do see a problem though regarding rotation. For instance, when rotating a page 90 degrees where width != height, you'll always cut part of the page.

n… via monorail

unread,
Aug 9, 2017, 4:35:24 PM8/9/17
to pdfiu...@googlegroups.com
Updates:
Status: Accepted

Comment #9 on issue 849 by n...@chromium.org: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c9

Oops, sent by accident.

I do see a problem though regarding rotation. For instance, when rotating a page 90 degrees where width != height, you'll always cut part of the page. I don't like the behavior of this method, I think we should just change it.

andr… via monorail

unread,
Aug 9, 2017, 4:38:28 PM8/9/17
to pdfiu...@googlegroups.com

Comment #10 on issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c10

Yes, as I said above I don't just need scaling but full transformation matrix application. So your suggestion might solve the problem with scaling but the problems will start all over again as soon as rotation comes into play... that's why FPDF_RenderPageBitmapWithMatrix() should be fixed generally so that it works for all cases.

andr… via monorail

unread,
Aug 24, 2017, 11:10:55 AM8/24/17
to pdfiu...@googlegroups.com

Comment #11 on issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c11

Nagging not intended but is this going to be fixed anytime soon? A working FPDF_RenderPageBitmapWithMatrix() function is really important for my project so I'd be really glad if this could be fixed rather soon... thanks!

n… via monorail

unread,
Aug 24, 2017, 11:43:25 AM8/24/17
to pdfiu...@googlegroups.com

Comment #12 on issue 849 by n...@chromium.org: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c12

I haven't had the time to dig into this to see what's the proper fix. I only work in PDFium 1 day a week and have many bugs assigned, but will try to get to this soon. Thanks for your patience!

andr… via monorail

unread,
Aug 25, 2017, 8:36:15 AM8/25/17
to pdfiu...@googlegroups.com

Comment #13 on issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c13

Thanks, very appreciated.

andr… via monorail

unread,
Aug 25, 2017, 8:36:45 AM8/25/17
to pdfiu...@googlegroups.com

Comment #14 on issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c14

andr… via monorail

unread,
Aug 25, 2017, 8:37:35 AM8/25/17
to pdfiu...@googlegroups.com

Comment #15 on issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c15

Why are my comments deleted automatically? That's weird.

andr… via monorail

unread,
Sep 3, 2017, 7:08:54 AM9/3/17
to pdfiu...@googlegroups.com

Comment #16 on issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c16

This is a test 1234. Comments 13, 14, 15 were also by me but they were automatically deleted. I don't know why.

andr… via monorail

unread,
Sep 3, 2017, 7:09:36 AM9/3/17
to pdfiu...@googlegroups.com

Comment #17 on issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c17

Ok, so commenting seems to be working again :) All I wanted to say is thanks for looking into this :)

bugdro… via monorail

unread,
Sep 13, 2017, 6:13:10 PM9/13/17
to pdfiu...@googlegroups.com

Comment #18 on issue 849 by bugd...@chromium.org: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c18

The following revision refers to this bug:
https://pdfium.googlesource.com/pdfium/+/24b0733a72bbc4013bff8628f198b0aea807aa06

commit 24b0733a72bbc4013bff8628f198b0aea807aa06
Author: Nicolas Pena <n...@chromium.org&gt;
Date: Wed Sep 13 22:12:47 2017

Change behaviour of FPDF_RenderPageBitmapWithMatrix

This CL changes the behavior of FPDF_RenderPageBitmapWithMatrix so it
transforms the bitmap. Before, the page would be transformed and the
assumption was that it would be drawn on a bitmap with the same
dimensions as the original page. This does not work well because a
transformation generally changes the dimensions of the page. The
rectangles test is modified to include small rectangles in the corner
of the page, so that it's clear that the whole original page is being
displayed.

Bug: pdfium:849
Change-Id: Ie89f959a1605fea59a15d239ca871ccd939ec92b
Reviewed-on: https://pdfium-review.googlesource.com/13510
Commit-Queue: Nicolás Peña <n...@chromium.org&gt;
Reviewed-by: Lei Zhang <the...@chromium.org&gt;
Reviewed-by: Henrique Nakashima <hnaka...@chromium.org&gt;

[modify] https://crrev.com/24b0733a72bbc4013bff8628f198b0aea807aa06/core/fpdfapi/page/cpdf_page.cpp
[modify] https://crrev.com/24b0733a72bbc4013bff8628f198b0aea807aa06/core/fpdfapi/page/cpdf_page.h
[modify] https://crrev.com/24b0733a72bbc4013bff8628f198b0aea807aa06/public/fpdfview.h
[modify] https://crrev.com/24b0733a72bbc4013bff8628f198b0aea807aa06/testing/resources/rectangles.in
[modify] https://crrev.com/24b0733a72bbc4013bff8628f198b0aea807aa06/testing/resources/rectangles.pdf
[modify] https://crrev.com/24b0733a72bbc4013bff8628f198b0aea807aa06/fpdfsdk/fpdfview.cpp
[modify] https://crrev.com/24b0733a72bbc4013bff8628f198b0aea807aa06/fpdfsdk/fpdfview_embeddertest.cpp

andr… via monorail

unread,
Sep 14, 2017, 12:01:44 PM9/14/17
to pdfiu...@googlegroups.com

Comment #19 on issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c19

Thanks! Unfortunately, it still doesn't work correctly. When using a transformation matrix that contains rotation, FPDF_RenderPageBitmapWithMatrix() seems to apply some scaling as well.

I'm attaching a very small demo program which shows the issue. You have to pass the name of a PDF and a rotation angle in degrees, e.g.

$ ./a.out test.pdf 45

The program will then use FPDF_RenderPageBitmapWithMatrix() to get the very first page of the PDF with the desired rotation and it will save it to a BMP picture in the current directory.

When using angles which result in rectangular shapes like 90,180,270 everything is fine. But when using other angles like 45 degrees, the page is not only rotated but also stretched/distorted which is wrong behaviour AFAICS.


Attachments:
test.c 4.5 KB

n… via monorail

unread,
Sep 14, 2017, 12:37:51 PM9/14/17
to pdfiu...@googlegroups.com

Comment #20 on issue 849 by n...@chromium.org: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c20

I'm aware of that problem (I added a to-do for that), just not sure how to fix it and what's the proper fix. That is, do we just want white pixels on the parts of the bitmap that don't corresponds to any part of the rotated page? A 45 degree rotation can only be represented properly in our rectangular bitmaps if there's some 'leftover' space, and it seems currently pdfium code avoids that by trimming the page so every location in the bitmap corresponds to a location in the page.

andr… via monorail

unread,
Sep 14, 2017, 12:45:08 PM9/14/17
to pdfiu...@googlegroups.com

Comment #21 on issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c21

Why not just leave the blank pixels untouched? FPDF_RenderPageBitmapWithMatrix() should just set the pixels in the bitmap that are actually used by the rotated image and leave all other pixels to whatever state they are currently in. As you can see in my demo code I'm calling FPDF_FillRect() before FPDF_RenderPageBitmapWithMatrix() so it wouldn't be a problem if FPDF_RenderPageBitmapWithMatrix() just left the empty pixels untouched.

Trimming the page just to fill every pixel in the bitmap sounds like a very weird method of operation IMHO because it clearly ignores the transformation matrix passed to FPDF_RenderPageBitmapWithMatrix().

andr… via monorail

unread,
Sep 14, 2017, 1:17:11 PM9/14/17
to pdfiu...@googlegroups.com

Comment #22 on issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c22

Another reasonable behaviour that comes to my mind would be to set the alpha value of all pixels that are blank because of the rotation to 0, thus making them invisible. I'd actually like this behaviour even more than my previous suggestion because it would make extraction of the pixel data easier. I'd just have to grab all pixels whose alpha value is != 0 from the bitmap then.

andr… via monorail

unread,
Nov 19, 2017, 3:27:31 PM11/19/17
to pdfiu...@googlegroups.com

Comment #23 on issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c23

Any chance that this going to see a fix anytime soon? Proper page transformation is really important for my app...

n… via monorail

unread,
Nov 20, 2017, 11:11:34 AM11/20/17
to pdfiu...@googlegroups.com
Updates:
Owner: ----

Comment #24 on issue 849 by n...@chromium.org: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c24

I'm unassigning myself, the core PDFium team might be able to resolve this faster.

n… via monorail

unread,
Nov 20, 2017, 11:11:35 AM11/20/17
to pdfiu...@googlegroups.com
Updates:
Cc: n...@chromium.org

Comment #25 on issue 849 by n...@chromium.org: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c25


(No comment was entered for this change.)

dsincl… via monorail

unread,
Nov 20, 2017, 11:15:28 AM11/20/17
to pdfiu...@googlegroups.com

Comment #26 on issue 849 by dsin...@chromium.org: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c26

This issues is on our backlog but low priority for us. If you want to look into the fix yourself we're happy to give pointers and review CLs.

Currently, we have no timeframe in which this issue will be fixed.

andr… via monorail

unread,
Nov 20, 2017, 11:25:31 AM11/20/17
to pdfiu...@googlegroups.com

Comment #27 on issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c27

Ok, I'll try to fix it on my own. I guess the code to handle transformation is already there and all that needs to be fixed is drawing the transformed page correctly into a bitmap. Doesn't sound like it's too difficult to solve this but of course I know nothing about the PDFium internals so no promises...

andr… via monorail

unread,
Jan 7, 2018, 8:45:38 AM1/7/18
to pdfiu...@googlegroups.com

Comment #28 on issue 849 by andr...@airsoftsoftwair.de: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c28

I've now fixed this issue but it's not a general fix. It merely just makes it work for me. For the record, here's what I did: CPDF_Page::GetDisplayMatrixWithTransformation() does a lot of stuff to the transformation matrix that makes no sense for my purposes so I just killed it and replaced it with the following three lines:

CFX_Matrix matrix = m_PageMatrix;
matrix.Concat(transformation);
return matrix;

My host program which calls FPDF_RenderPageBitmapWithMatrix() then first flips the page upside down by applying a matrix of (1,0,0,-1,0,0), like so:

t.a = 1 * transform->a + 0 * transform->c;
t.b = 1 * transform->b + 0 * transform->d;
t.c = 0 * transform->a + -1 * transform->c;
t.d = 0 * transform->b + -1 * transform->d;

Then it uses the matrix in "t" to transform a rectangle of the page dimensions, i.e (0,0,pageWidth,pageHeight):

transformrect(0, 0, pageWidth, pageHeight, &t, &bx, &by, &bwidth, &bheight);

The transformrect() function returns the transformed rectangle's bounding box in (bx,by,bwidth,bheight). The last step that is necessary is to translate the "t" matrix by the bounding box offsets, like so:

t.e = (float) -bx;
t.f = (float) -by;

And that's it. I can now pass "t" to FPDF_RenderPageBitmapWithMatrix() and it will correctly render the transformed page to my bitmap. The bitmap has to be of the size (bwidth,bheight).

In order to get a white background in the background of the transformed page I have added a function called FPDFPage_PrependObject(). This does the same as FPDFPage_InsertObject() but it inserts the object at the bottom of the stack, i.e. all the way in the background. I then use FPDFPage_PrependObject() to insert a filled white rectangle that covers the whole page dimensions as the very first object. This is then nicely transformed with the whole page when calling FPDF_RenderPageBitmapWithMatrix().

So finally things work like they should with FPDF_RenderPageBitmapWithMatrix(). But I'm still hoping for an official fix because my one is rather hackish of course ;)

Also note that my PDFium snapshot is from 14th September 2017 so maybe things have changed in the meantime...

hnakash… via monorail

unread,
Jan 16, 2018, 5:01:00 PM1/16/18
to pdfiu...@googlegroups.com
Updates:
Owner: hnaka...@chromium.org
Status: Started

Comment #29 on issue 849 by hnaka...@chromium.org: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c29


(No comment was entered for this change.)

hnakash… via monorail

unread,
Jan 17, 2018, 12:03:06 PM1/17/18
to pdfiu...@googlegroups.com

Comment #30 on issue 849 by hnaka...@chromium.org: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c30

I have a CL out in review that should solve your original bug.

https://pdfium-review.googlesource.com/c/pdfium/+/22931

bugdro… via monorail

unread,
Jan 17, 2018, 3:01:16 PM1/17/18
to pdfiu...@googlegroups.com

Comment #31 on issue 849 by bugd...@chromium.org: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c31


The following revision refers to this bug:
https://pdfium.googlesource.com/pdfium/+/2914b6f1303445025764ec2d9f01a3be2df5cec0

commit 2914b6f1303445025764ec2d9f01a3be2df5cec0
Author: Henrique Nakashima <hnaka...@chromium.org>
Date: Wed Jan 17 20:00:37 2018

Fix behavior of FPDF_RenderPageBitmapWithMatrix

This functional part of this CL is mostly a revert of
"Change behaviour of FPDF_RenderPageBitmapWithMatrix"
24b0733a72bbc4013bff8628f198b0aea807aa06

Besides the revert, the parameters passed to
pPage->GetDisplayMatrix() are changed to fix a bug with the previous
implementation: the page was scaled to fit inside the clipping_rect,
instead of clipped.

Bug: pdfium:849
Change-Id: I95d0a303a979c998026a3bd6963c8684a1209f03
Reviewed-on: https://pdfium-review.googlesource.com/22931
Reviewed-by: Nicolás Peña Moreno <n...@chromium.org>
Reviewed-by: dsinclair <dsin...@chromium.org>
Commit-Queue: Henrique Nakashima <hnaka...@chromium.org>

[modify] https://crrev.com/2914b6f1303445025764ec2d9f01a3be2df5cec0/fpdfsdk/fpdfview_embeddertest.cpp
[modify] https://crrev.com/2914b6f1303445025764ec2d9f01a3be2df5cec0/fpdfsdk/fpdfview.cpp
[modify] https://crrev.com/2914b6f1303445025764ec2d9f01a3be2df5cec0/core/fpdfapi/page/cpdf_page.cpp
[modify] https://crrev.com/2914b6f1303445025764ec2d9f01a3be2df5cec0/core/fpdfapi/page/cpdf_page.h

hnakash… via monorail

unread,
Oct 10, 2018, 4:52:52 PM10/10/18
to pdfiu...@googlegroups.com
Updates:
Status: Fixed

Comment #32 on issue 849 by hnaka...@chromium.org: FPDF_RenderPageBitmapWithMatrix() still not behaving properly
https://bugs.chromium.org/p/pdfium/issues/detail?id=849#c32

I think I should have marked this as fixed a while ago.
Reply all
Reply to author
Forward
0 new messages