Diễn đàn    Cổng thông tin , Chính phủ điện tử, VSP (VerySmart Portal), MVC Model View Controller, json, webapi    Tạo file PDF với ItextSharp

17  bài
16-1-2023 11:5:0
Document document = new Document(PageSize.A4, 25, 25, 30, 30);
PdfWriter writer = PdfWriter.GetInstance(document, fs);

string OPENSAN_TFF = Server.MapPath("/css/OpenSans.TTF");

//Create a base font object making sure to specify IDENTITY-H
BaseFont bf = BaseFont.CreateFont(OPENSAN_TFF, BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);

//Create a specific font object
Font f = new Font(bf, 12, Font.NORMAL);


document.Open();
document.Add(new Paragraph("Hello World!"));

document.Close();
writer.Close();

fs.Close();
 

Lập trình không biên giới

608  bài
16-1-2023 11:5:12
private Paragraph MakeParagraphAlign(string str, string align, Font f)
{
Paragraph p = new Paragraph(str, f);
switch (align)
{
case "r":
p.Alignment = Element.ALIGN_RIGHT;break;
case "c":
p.Alignment = Element.ALIGN_CENTER; break;
};
return p;
}
---
Cây sẽ cho lộc và cây sẽ cho hoa ...
 
Tên file Mô tả chi tiết Ngày
NWeb.zip (1) Module đơn giản Newsweb trên Dotnetnuke v10.x.x.x10/18/2025 8:08:11 AM
vspforum.zip (11) Ma nguon vspforum ngay xua4/18/2023 6:38:37 AM
pdfjs.rar (2) pdfjs 2017 : hiển thị tốt trên iphone 11, 12, 13 không lỗi, bản 2012 sẽ lỗi trên iphone6/21/2022 11:52:48 AM
pdfjs2.rar (2) Xem file pdf bằng viewer.hml cua pdfjs (thư viện chuẩn mozilla) 2012. https://mozilla.github.io/pdf.js/getting_started/#download có thể download bản prebuild tại đây6/21/2022 11:52:04 AM
runner.zip (0) using three.js, orbitcontrol to view an object move random on map. Di chuyển 1 đồ vật ngẫu nhiên trên bản đồ, sử dụng với demo nhân viên di chuyển trong văn phòng. Toàn js download về là chạy12/5/2019 5:55:14 PM
gmap.zip (1) google map + marker7/17/2019 2:25:05 PM
vinsmarthomeservice.zip (1) java post json to api, use AsyncTask, event listener7/9/2019 5:00:10 PM
fblogin.zip (0) Login facebook bang javascript SDK7/9/2019 9:16:37 AM
autocomplete-location.zip (2) autocomplete location geo from google place, html + js7/4/2019 4:37:55 PM
WebAPI.zip (8) api for android access db (v1.0.0)7/4/2019 9:14:17 AM