iTextSharp? ???? ?? ?? ??? ??
??:
iTextSharp? PDF ??? ???? ???? ?? ??? ???????? ??? ??? ???? ???? ???? ?? ??? ? ????. ? ????? iTextSharp? ???? PDF?? ??? ? ?? ??? ???? ??? ?????.
??? ?? ?? ??:
?? ?? ???? ????? ??? ?? ITextExtractionStrategy ??? ??? ? ????. ? ??? ??? ??? ??? ???? ??? ?????.
?? ??:
?? ??? ???, ?? ?? ? ?? ??? ?? ??? ???? ??? ???? ???? HTML? ???? ??? ?? ??? ?????.
<code>public class TextWithFontExtractionStategy : iTextSharp.text.pdf.parser.ITextExtractionStrategy { // ... (此處省略) public void RenderText(iTextSharp.text.pdf.parser.TextRenderInfo renderInfo) { // 確定字體屬性 string curFont = renderInfo.GetFont().PostscriptFontName; if (renderInfo.GetTextRenderMode() == (int)TextRenderMode.FillThenStrokeText) { curFont += "-Bold"; } // 檢查基線、字體或字體大小的變化 Vector curBaseline = renderInfo.GetBaseline().GetStartPoint(); Single curFontSize = renderInfo.GetAscentLine().GetEndPoint()[Vector.I2] - curBaseline[Vector.I2]; if ((this.lastBaseLine == null) || (curBaseline[Vector.I2] != lastBaseLine[Vector.I2]) || (curFontSize != lastFontSize) || (curFont != lastFont)) { // 生成帶有更新樣式的HTML span result.AppendFormat("</code>
???:
?? ??? ????? ???? ??? ? ?? ??? ? ????.
<code>PdfReader reader = new PdfReader("MyDocument.pdf"); TextWithFontExtractionStategy strategy = new TextWithFontExtractionStategy(); string textWithFormatting = PdfTextExtractor.GetTextFromPage(reader, 1, strategy);</code>
??:
textWithFormatting ???? ?? ? ?? ??? ??? ?? ??? ???? HTML ??? ?? ??? ???? ?????.
??:
? ??? ?? ?? ??? ???? ??? ???? PDF ???? ??? ? ????. ?? PDF ??? ???? ???? ???? ???? ? ??? ? ?? ??? ?????.
? ??? iTextSharp? ???? PDF?? ??? ??? ???? ???? ??? ??????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











C? ???? ?? ??? ?? ???? ?? ???? ??? ??? ?? ???? ??????. 1) ?? ??? ?? ???? ?? ??? ??? ??? ??????. 2) ?? ??? ?????? ???? ?? ? ???? ?? ?? ??? ?????. ? ????? ????? ???? ?? ???? ??? ? ??? ?? ?? ? ?? ???? ??? ?????? ???????.

?, ?? ???? C? ??? ??, ?? ??? ? ??????. 1. ?? ???? ??? ??? ?? ?? ??? ?? ?? ??? ?????. 2. ????? ??? ?? ??? ?? ??? ??? ?? ? ??? ?????. 3. ??? ???? ?? ?? ???? ???? ?? ?? ??? ??? ????? ????? ???? ?????.

C? ???? ??? ???? ??? ?????? ? ?????. 1) ???? ???? ?? ??? ?? ??? ????? ?? ? ???? ?????. 2) ?? ?? ?? ??, ?? ?? ? ?? ???? ???????. 3) ???? ??? ??? ?? RAII ??? ???? ??? ???? ??????. 4) ?? ????? ?? ???? ???? ?? ? ??? ??? ???? ????????. 5) ?? ? ?? ??? ???? ?? ?? ???? ?? ? ? ????. 6) ??? ?? ???? ???? ???? ?? ???? ??????.

C? ? ?? ?? ??? ??? ??? : ??? ?? ??? ? ??? ???. 1. ??? ?? ???? ?? ??? ? ???? ?? ????? ?? ??? ????? ?? ???? ??? ? ????. 2. ??? ???? ?? ?? ? ??? ?? ???? ???? ??? ?? ?? ??? ?????.

1) ?? ? ?? ?? ??, 2) ?? ??? ???? ?? ???? ????, 3) ?? ???? ?? ??? ?? ??? ?? ???? 4) ?? ??? ??? ?? ??? ???? ??? ??? ??????. ???? ???? ?? ??? ??? ??? ?? ??? ??? ???? ?? ???? ?? ??? ???? ? ????.

?, C? ???? ?? ?????. 1) ??? ??? ?? ?? ? ??? ???? ?????. 2) ?? ???? ???? ??? ????. 3) ?? ??? ????? ??? ?? ???? ??? ??? ? ??????. ?? ? ??? ?? ???? ???? ??? ?????? ??? ?? ?????.

C DestructorsCanleadToSeVeralCommonerrors.toaVoidthem : 1) ?? ?? ?? ?? ?? ?? ???

C? ???? ??? ??? ? ??? ?? ????? ????. 1. ??? ???? ?? ??? ?? ????? ???? ??? ??? ???? ?? ? ? ????. 2. ??? ?? ???? ?? ??? ? ???? ?? ????, ??? ???? ?????.
