当前位置: 首页>>代码示例>>Java>>正文


Java AcroFields.getAppearanceStates方法代码示例

本文整理汇总了Java中com.itextpdf.text.pdf.AcroFields.getAppearanceStates方法的典型用法代码示例。如果您正苦于以下问题:Java AcroFields.getAppearanceStates方法的具体用法?Java AcroFields.getAppearanceStates怎么用?Java AcroFields.getAppearanceStates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.itextpdf.text.pdf.AcroFields的用法示例。


在下文中一共展示了AcroFields.getAppearanceStates方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testShowPdfExampleStates

import com.itextpdf.text.pdf.AcroFields; //导入方法依赖的package包/类
/**
 * <a href="http://stackoverflow.com/questions/39450688/itext-pdf-checkboxon-off-not-appearing-for-some-pdf">
 * IText Pdf - Checkbox(On/Off) not appearing for some pdf
 * </a>
 * <br/>
 * <a href="http://www.filedropper.com/pdfexample_1">
 * PDF example.pdf
 * </a>
 * <p>
 * The observations of the OP cannot be reproduced.
 * </p>
 */
@Test
public void testShowPdfExampleStates() throws IOException
{
    String resourceName = "PDF example.pdf";
    try (   InputStream resource = getClass().getResourceAsStream(resourceName)    )
    {
        PdfReader reader = new PdfReader(resource);
        AcroFields form = reader.getAcroFields();
        String[] values = form.getAppearanceStates("claimsType");
        System.out.printf("\n%s\nThe appearance states of claimsType are %s.\n", resourceName, Arrays.asList(values));
    }
}
 
开发者ID:mkl-public,项目名称:testarea-itext5,代码行数:25,代码来源:ShowStates.java

示例2: testShowPdfTest2States

import com.itextpdf.text.pdf.AcroFields; //导入方法依赖的package包/类
/**
 * <a href="http://stackoverflow.com/questions/39450688/itext-pdf-checkboxon-off-not-appearing-for-some-pdf">
 * IText Pdf - Checkbox(On/Off) not appearing for some pdf
 * </a>
 * <br/>
 * <a href="http://www.filedropper.com/pdftest2">
 * PDF test 2.pdf
 * </a>
 * <p>
 * The observations of the OP cannot be reproduced.
 * </p>
 */
@Test
public void testShowPdfTest2States() throws IOException
{
    String resourceName = "PDF test 2.pdf";
    try (   InputStream resource = getClass().getResourceAsStream(resourceName)    )
    {
        PdfReader reader = new PdfReader(resource);
        AcroFields form = reader.getAcroFields();
        String[] values = form.getAppearanceStates("claimsType");
        System.out.printf("\n%s\nThe appearance states of claimsType are %s.\n", resourceName, Arrays.asList(values));
    }
}
 
开发者ID:mkl-public,项目名称:testarea-itext5,代码行数:25,代码来源:ShowStates.java

示例3: setField

import com.itextpdf.text.pdf.AcroFields; //导入方法依赖的package包/类
private static void setField(AcroFields fields, String key, Boolean value) {
  String[] states = fields.getAppearanceStates(key);
  if(states.length > 0) setField(fields, key, states.length > 1 ? states[value.booleanValue() ? 1 : 0] : states[0]);
}
 
开发者ID:obiba,项目名称:mica2,代码行数:5,代码来源:PdfUtils.java


注:本文中的com.itextpdf.text.pdf.AcroFields.getAppearanceStates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。