我正在保存图像,但我需要将此图像转换为 pdf 并保存。我怎样才能做到这一点?
这是我使用的代码:
private void button3_Click(object sender, EventArgs e)
{
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.FileName = "image.bmp";
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
Bitmap bitmap = new Bitmap(this.Width, this.Height);
this.DrawToBitmap(bitmap, this.ClientRectangle);
using (var Stream = saveFileDialog1.OpenFile())
{
bitmap.Save(Stream, ImageFormat.Bmp);
}
}
}