第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何使用iTextSharp進(jìn)行文本格式化

如何使用iTextSharp進(jìn)行文本格式化

森欄 2019-08-08 16:57:21
如何使用iTextSharp進(jìn)行文本格式化我正在使用iTextSharp從PDF中讀取文本內(nèi)容。我也能讀到這一點(diǎn)。但我正在丟失文字格式,如字體,顏色等。有沒有辦法獲得格式。以下是我用于確切文本的代碼段 -PdfReader reader = new PdfReader("F:\\EBooks\\AspectsOfAjax.pdf");textBox1.Text = ExtractTextFromPDFBytes(reader.GetPageContent(1));private string ExtractTextFromPDFBytes(byte[] input){     if (input == null || input.Length == 0) return "";     try     {         string resultString = "";         // Flag showing if we are we currently inside a text object         bool inTextObject = false;         // Flag showing if the next character is literal  e.g. '\\' to get a '\' character or '\(' to get '('         bool nextLiteral = false;         // () Bracket nesting level. Text appears inside ()         int bracketDepth = 0;         // Keep previous chars to get extract numbers etc.:         char[] previousCharacters = new char[_numberOfCharsToKeep];         for (int j = 0; j < _numberOfCharsToKeep; j++) previousCharacters[j] = ' ';         for (int i = 0; i < input.Length; i++)         {             char c = (char)input[i];             if (inTextObject)             {                 // Position the text                 if (bracketDepth == 0)                 {                     if (CheckToken(new string[] { "TD", "Td" }, previousCharacters))                     {                         resultString += "\n\r";                     }                     else                     {                         if (CheckToken(new string[] {"'", "T*", "\""}, previousCharacters))                         {                             resultString += "\n";                         }                         else                         {                             if (CheckToken(new string[] { "Tj" }, previousCharacters))                             {                                 resultString += " ";                             }                         }                     }                 }
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 706 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)