1
我有一個將報告呈現爲pdf表單的c#代碼。將報告呈現爲pdf
Random rand = new Random();
num = rand.Next(1111, 999999);
Warning[] warnings;
string[] streamids;
string mimeType;
string encoding;
string extension;
String deviceInf = "<DeviceInfo><PageHeight>8.27in</PageHeight><PageWidth>11.69in</PageWidth><MarginTop>0in</MarginTop><MarginBottom>0in</MarginBottom><MarginLeft>0in</MarginLeft><MarginRight>0in</MarginRight></DeviceInfo>";
byte[] bytes = reportViewer1.LocalReport.Render
(
"PDF", deviceInf, out mimeType, out encoding,
out extension,
out streamids, out warnings);
var folderPath = "D:\\ICard\\STAFFPDF\\";
if (!Directory.Exists(folderPath))
{
Directory.CreateDirectory(folderPath);
}
FileStream fs = new FileStream(@"D:\ICard\STAFFPDF\" + num + ".pdf", FileMode.Create);
fs.Write(bytes, 0, bytes.Length);
this.reportViewer1.Refresh();
fs.Close();
什麼,我試圖做的是保存PDF的鏡面形式,因爲PDF需要被打印成鏡像,有沒有什麼辦法,我可以做到這一點?
我需要的是打印PDF格式的鏡像,這看起來只是爲了呈現PDF報告,我已經能夠做到了。 – Sdp
https://forums.asp.net/t/1780504.aspx?I+want+the+code+for+pdf+to+image+conversion+in+c+ 請參閱此鏈接。它明確說明。 –
謝謝你的參考 – Sdp