Adding an image to a PDF using iTextSharp and scale it properly

后端 未结 5 1514
忘掉有多难
忘掉有多难 2020-12-01 10:27

here\'s my code. It correctly adds the pictures I want and everything works except that the images are using their native resolution, so if the image is big

5条回答
  •  春和景丽
    2020-12-01 11:03

    Personally, I use something close from fubo's solution and it works well:

    image.ScaleToFit(document.PageSize);
    image.SetAbsolutePosition(0,0);
    

提交回复
热议问题