我有以下代碼
Document pdfDoc = new Document(PageSize.A4, 25, 25, 25, 10);
string pathfile = ConfigurationManager.AppSettings["Temp_SaveLocation"];
string fileName = "SomeName.pdf";
path = pathfile fileName;
PdfWriter pdfWriter = PdfWriter.GetInstance(pdfDoc, new FileStream(path, FileMode.Create));
pdfDoc.Open();
Image imghead = Image.GetInstance(templateFolder "Letterhead.png");
pdfDoc.Add(imghead);
pdfWriter.CloseStream = true;
pdfDoc.Close();
我正在嘗試正確對齊 PDF 檔案頂部的信頭,以使其看起來不錯且適合
我試過 imghead.ScaleAbsoluteWidth(pdfDoc.PageSize.Width); 但信頭仍然被切斷。我還嘗試設定 Width 屬性,但沒有縱橫比,因此信頭看起來很奇怪
是否有任何特定方法可以將信頭正確放置在 PDF 之上?
非常感謝您提前
uj5u.com熱心網友回復:
這是我一直在尋找的答案
imghead.ScaleToFit(150f, 150f);
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/447071.html
上一篇:簽名后無法保存pdf
