2017-09-21 11 views
2

連続したテキストを折り返すコードを追加しました。ここでは例えばURLです。 これらのCSSはWebブラウザーで作業してもうまく動作しますが、pdfにエクスポートするとURLは折り返されません。継続テキストを灰色で塗りつぶす

正確な問題点を特定できません。オンラインおよびPDFビューの参照動作の

画像:

Image for reference behavior of the online and pdf view

CSS

.background-color-dark-blue { 
 
    background-color: #485679; 
 
} 
 
.color-light { 
 
    color: #fff !important; 
 
} 
 

 

 
.white-space-pre-wrap a { 
 
    word-break: break-all !important; 
 
    word-wrap: break-word; 
 
    word-wrap: break-word !important; 
 
    
 
} 
 
.break-all { 
 
    word-break: break-all; 
 
    word-wrap: break-word; 
 
} 
 

 
.url-style a { 
 
    /*font-size: 14px;*/ 
 
    line-height: 1.3; 
 
    color: #2a99d4; 
 
    font-weight: 700; 
 
    text-decoration: none; 
 
    margin-top: 0px !important; 
 
}
<table> 
 
               <colgroup> 
 
                <col class="col-3"> 
 
                <col class="col-4"> 
 
                <col class="col-5"> 
 
               </colgroup> 
 
               <thead> 
 
                <tr class="background-color-dark-blue "> 
 
                 <th class="color-light"> 
 
                  Document Name</th> 
 
                 <th class="color-light"> 
 
                  Document Description</th> 
 
                 <th class="color-light"> 
 
                  Location/Link</th> 
 
                </tr> 
 
               </thead> 
 
               <tbody> 
 
                
 
             <tr class="bg-color-lighter"> 
 
              <td class="va-top">FATF 40 Recommendations</td> 
 
              <td class="va-top">Global standard for AML/CFT published by the Financial Action Task Force </td> 
 
              <td class="review-report-url-fix padding-left-5 break-all va-top"> 
 
               <div class="break-all va-top"> 
 
               <a id="SiteContentPlaceHolder_AppendicesReviewControl_ReferenceDocumentListView_ReferenceDocumentLink_0" title="http://www.fatf-gafi.org/publications/fatfrecommendations/ 
 
http://www.fatf-gafi.org/publications/fatfrecommendations/documents/risk-based-approach-banking-sector.html" class="url-style white-space-pre-wrap" href="http://www.fatf-gafi.org/publications/fatfrecommendations/%0d%0a%20http://www.fatf-gafi.org/publications/fatfrecommendations/documents/risk-based-approach-banking-sector.html" target="_blank">http://www.fatf-gafi.org/publications/fatfrecommendations/ 
 
http://www.fatf-gafi.org/publications/fatfrecommendations/documents/risk-based-approach-banking-sector.html</a> 
 
                </div> 
 
               
 
              </td> 
 

 
             </tr> 
 
            
 
             <tr class="bg-color-dashboard-table"> 
 
              <td class="va-top">Risk Based Approach Guidance for Legal Professionals</td> 
 
              <td class="va-top">Guidance on the AML/CFT Risk Based Approach for lawyers and the legal profession</td> 
 
              <td class="review-report-url-fix padding-left-5 va-top"> 
 
               <div class="break-all va-top"> 
 
               <a id="SiteContentPlaceHolder_AppendicesReviewControl_ReferenceDocumentListView_ReferenceDocumentLink_1" title="http://www.fatf-gafi.org/publications/fatfrecommendations/documents/riskbasedapproachguidanceforlegalprofessionals.html" class="url-style white-space-pre-wrap" href="http://www.fatf-gafi.org/publications/fatfrecommendations/documents/riskbasedapproachguidanceforlegalprofessionals.html" target="_blank">http://www.fatf-gafi.org/publications/fatfrecommendations/documents/riskbasedapproachguidanceforlegalprofessionals.html</a> 
 
                </div> 
 
               
 
              </td> 
 

 
             </tr>         
 
            
 
               </tbody> 
 
              </table>

+0

は、念のため:あなたはどのiTextのバージョンを使用していますか? 5.5.xと 'XmlWorker'または7.0.xと' HtmlConverter'を使用していますか? – mkl

+0

私はちょうどiTextサポートシステムの最近のチケットの詳細を見ましたが、あなたはこれを報告した同じ顧客です。この問題を担当している私の同僚は、JIRAを介してソリューションを提供します。スタックオーバーフローに関するソリューションは掲載しません。しかし、あなたが私たちからそれを取得したら、あなたはそのソリューションをStack Overflowにコピーすることができます。 –

+0

私はItextバージョン7.0を使用しています –

答えて

0

iTextのバージョン7.0でURLをラップする方法はありますinbuildライブラリ関数を持っています

SetSplitCharacters(ISplitCharacters splitCharacters);

だから、iTextの7

public string SplitChars { get; set; } = ".+-/"; 
var document = new Document(pdf, PageSize.LETTER, false) 
document.SetSplitCharacters(new CustomSplitCharacters(SplitChars)); 

が今連続URLがであらゆる壊れる利用コードの文字を分割する+ - 。/それは表のセル

Reffer URLのの末尾にあるとき、ライブラリ関数

http://itextsupport.com/apidocs/itext7/7.0.4/com/itextpdf/layout/ElementPropertyContainer.html

関連する問題