[英]PDFSharp not working
我正在嘗試將位圖保存為.pdf
文件。 沒用 我沒有收到錯誤,但是它沒有打開對話框來保存.pdf
文件。
這是我的代碼:
PdfDocument doc = new PdfDocument();
for (int iCnt = 0; iCnt < nPaginasPDF; iCnt++)
{
doc.Pages.Add(new PdfPage());
XGraphics xgr = XGraphics.FromPdfPage(doc.Pages[iCnt]);
XImage img = XImage.FromFile("C:\\" + (iCnt+1) + ".bmp"); (In this directory have these image files)
xgr.DrawImage(img, panel1.ClientRectangle);
}
using (var Stream = saveFileDialog1.OpenFile())
{
doc.Save(Stream);
}
doc.Close();
SaveFileDialog
的OpenFile
方法打開具有讀取/寫入權限的SaveFileDialog.Filename
屬性文件返回的文件。
要在保存之前選擇文件,必須首先使用ShowDialog
方法。 您是否已調試並使用斷點檢查Stream
的值?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.