国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開(kāi)通VIP
iTextSharp 將txt 轉(zhuǎn)換成pdf
private void doTXTtoPDFWork()
      
{
            
try
          
{
             iTextSharp.text.Rectangle c6 
= new iTextSharp.text.Rectangle(480600);
               Document document 
= new Document(c6);
               
string pdfSavePath = txtPath.Substring(0, txtPath.Length - 3);
              pdfSavePath 
+= "pdf";
              PdfWriter writer 
= PdfWriter.GetInstance(document, new FileStream(pdfSavePath, FileMode.Create));//創(chuàng)建Writer實(shí)例
            document.Open();

                document.AddAuthor(
"androidxiamen");
                
//             document.AddCreationDate();
                
//             document.AddCreator("廈門同步網(wǎng)絡(luò)有限公司");

                
//             document.AddKeywords("移動(dòng)互聯(lián)網(wǎng)");
                
//             document.AddProducer();
                
//             document.AddSubject("kindle 6 寸");
                
//             document.AddTitle("明朝那些事");



                BaseFont bfHei 
= BaseFont.CreateFont(@"C:\WINDOWS\Fonts\simhei.ttf", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
                iTextSharp.text.Font font 
= new iTextSharp.text.Font(bfHei, 20);


                
float titleLineHeight = 45f; 
                
float normalLineHeight = 20f;

                Paragraph pBlank 
= new Paragraph(" ", font);
                pBlank.Leading 
= normalLineHeight;

                StreamReader sr 
= new StreamReader(txtPath, GetEncoding(txtPath));
                String line 
= "";

                
while ((line = sr.ReadLine()) != null)
              
{
                  
if (line == "")
                 
{
                        document.Add(pBlank);
//空行
                    }

                    Chunk chnk4 
= new Chunk(line, font);

                    document.Add(GetPTxt(
new Chunk[] { chnk4 }, normalLineHeight));

                    curLine
++;
                    UpdateUIPro();
                }

                sr.Close();

                document.Close();
                UpdateUIFinish();
        }

            
catch
         
{
              MessageBox.Show(
"哦,出現(xiàn)了未知的情況,我已經(jīng)快掛了!!");
       }

         
    }
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
C# 生成PDF詳解(支持中文、水印、頁(yè)眉、頁(yè)腳、表格等) | 真有意思
iTextSharp使用小結(jié)
C#使用iTextSharp封裝的PDF文件操作類實(shí)例
C#的office文檔操作(9)
將GridView導(dǎo)出為PDF 通過(guò)itextsharp
asp.net 2.0 中生成PDF
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服