Skip to content

Update sample for How to Convert PDF Pages to Images and Crop Them to Exact Size Using PdfToImageConverter in C##92

Open
Yaminisrisf4389 wants to merge 2 commits into
masterfrom
883303
Open

Update sample for How to Convert PDF Pages to Images and Crop Them to Exact Size Using PdfToImageConverter in C##92
Yaminisrisf4389 wants to merge 2 commits into
masterfrom
883303

Conversation

@Yaminisrisf4389
Copy link
Copy Markdown
Collaborator

Update sample for How to Convert PDF Pages to Images and Crop Them to Exact Size Using PdfToImageConverter in C#


int pageCount = imageConverter.PageCount;

for (int i = 0; i < pageCount; i++)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of all the pages do operation for the first page

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have modified the code with single page

int cropHeight = 300;
SKRectI cropRect = new SKRectI(cropX, cropY, cropX + cropWidth, cropY + cropHeight);

if (cropRect.Right > originalBitmap.Width ||
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this portion as we are providing the bounds directly

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per your suggestion I have removed this code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants