I want to resize the PDFium control.

Asked 5 months ago, Updated 5 months ago, 17 views

I would like to use PDFium to create a PDF viewer Windows app.
I am having trouble changing the size of the PDFium.


Even so, the size does not.
How can I change the size?

windows pdf

2022-09-30 11:47

1 Answers

You seem to use the Control.Size Property property.
And the starting position in the upper left corner seems to be Control.Location Property.
The first parameter is horizontal and the second parameter is vertical.

Form1.Designer.cs I extracted it from the source and it was written like this

this.pdfViewer1.Location=new System.Drawing.Point(1,1);
this.pdfViewer1.Size=new System.Drawing.Size(500,300);

The following is for your reference
If it is the page of the document you are viewing, isn't it possible to change the size by setting the SizeMode property to SizeModes.Zoom and specifying a value (magnification?) in the Zoom property?

PdfViewer Properties

  • SizeMode
    Control how the PdfViewer will handle pages placement and control sizing
  • Zoom
    This property allows you to scale the PDF page. To take effect the SizeMode property should be Zoom

Examples of forum questions (The purpose of the question is different)

 float x=pdfViewer1.CurrentPage.Width/2;
    pdfViewer1.ScrollToPoint(0, newPointF(x,y));

github WinForms sample

2022-09-30 11:47

If you have any answers or tips

© 2023 OneMinuteCode. All rights reserved.