itextpdf | itextpdf freemarker 实现pdf的导出, 支持中文、图片以及外部样式 | Document Editor library

 by   youzhibing HTML Version: Current License: No License

kandi X-RAY | itextpdf Summary

kandi X-RAY | itextpdf Summary

itextpdf is a HTML library typically used in Editor, Document Editor applications. itextpdf has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

模板文件只是用于生成pdf, 所以双击打开的话, 图片和外部css是找不到的; 如果既想满足双击打开可以找到css和图片,又能通本工程中的示例, 那么需要另外处理了;至少本工程是没有兼容两者的. 1、目前只实现pdf文件的生成,与web项目pdf的导出还有些许不同, 但是已经支持中文、外部css、图片 可直接运行com.yzb.lee.test.Test.java的main方法来测试效果 文件路径:pdf.css在resources/css/目录下,aloner.jpg在resources/images/目录下, 模板文件是resources/template/template.html 获取java项目路径:2、servlet实现pdf的导出 工程部署后,请求地址:文件路径:pdf.css在webapp/css/目录下,aloner.jpg在webapp/images/目录下, 模板文件是resources/template/webTemplate.html 此时css文件、image文件与工程部署在同一个web容器中, 文件路径的获取与之前有所不同. 3、css、image等文件放到单独的文件服务器上 出于简单的演示效果,文件服务器与工程服务器还是同一个, css与image的链接方式与之前有所不同,可以看成是两个服务器 工程部署后,请求地址:文件路径:pdf.css、aloner.jpg在文件服务器上,写文件服务器的访问路径, 模板文件是resources/template/fileTemplate.html. 4、将字体-宋体 放到工程中, 以便适应不同操作系统的中文显示问题 工程部署后,请求地址:文件路径:pdf.css、aloner.jpg在文件服务器上,写文件服务器的访问路径, 模板文件是resources/template/fileTemplate.html 字体文件路径:resources/font/目录下. 5、阿里巴巴code review 阿里巴巴代码检视后,代码优化; 个人认为有可取的,但不是全部都可取 eclipse插件地址:
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              itextpdf has a low active ecosystem.
              It has 68 star(s) with 47 fork(s). There are 9 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 4 open issues and 1 have been closed. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of itextpdf is current.

            kandi-Quality Quality

              itextpdf has no bugs reported.

            kandi-Security Security

              itextpdf has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              itextpdf does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              itextpdf releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of itextpdf
            Get all kandi verified functions for this library.

            itextpdf Key Features

            No Key Features are available at this moment for itextpdf.

            itextpdf Examples and Code Snippets

            No Code Snippets are available at this moment for itextpdf.

            Community Discussions

            QUESTION

            iText7 - unable to load custom ttf font from jar
            Asked 2021-Jun-08 at 11:41

            Good day, dear colleagues.

            Could you please help me to understand why is this error appears when the spring boot app is packed into the jar and no cause when app is being debugged from IDE?

            ...

            ANSWER

            Answered 2021-Jun-08 at 11:41

            Don't use is.available() to determine the length of the resource because in general that's not what this method returns (see many other questions, e.g. this one).

            Instead copy the whole stream via a buffer or use a utility method.

            As you use iText 7, you can use its com.itextpdf.io.util.StreamUtil utility

            Source https://stackoverflow.com/questions/67884889

            QUESTION

            Remove Leading from the first Paragraph on every page itext 7 java
            Asked 2021-Jun-01 at 17:09

            I need to remove Leading property in first Paragrapg on every page(FixedLeading)?

            ...

            ANSWER

            Answered 2021-Jun-01 at 17:09

            Your approach seems plausible: I imagine it could be improved by looping through all the overflow renderers (perhaphs, I will try it out and update the answer someday).

            However, there is quite a different approach, which for me seems to be more convenient and accurate: why not to override ParagraphRenderer, so that leading is reset each time the corresponding Paragraph can not fit a page (and hence will be moved to the next page).

            This is how such an extension class may look:

            Source https://stackoverflow.com/questions/67703562

            QUESTION

            iText PDF: the document has no pages
            Asked 2021-May-29 at 18:57

            I'm trying to do a date range based filter to export a report into a PDF; however, when I click to export the PDF, I get the following message: ExceptionConverter: java.io.IOException: The document has no pages. Here's my PDF class' code:

            ...

            ANSWER

            Answered 2021-May-29 at 17:55
            1. It seems that your SQL request doesn't return any row,

            2. Put your PdfTable(3) out of your while();

            Source https://stackoverflow.com/questions/67754223

            QUESTION

            clientBuilder.sslSocketFactory(SSLSocketFactory) not supported on JDK 9+ while running maven build
            Asked 2021-May-20 at 07:36

            I have imported an existing maven project into eclipse. When I try to build the maven project I get error 'clientBuilder.sslSocketFactory(SSLSocketFactory) not supported on JDK 9+' message. I have JDK 8 and Maven version 'Apache Maven 3.0.5' installed. Eclipse Version is Photon Milestone 3 (4.8.0M3). My POM file looks like below.

            Can someone please help me resolve this?

            ...

            ANSWER

            Answered 2021-May-20 at 07:36

            This issue was resolved after I installed Eclipse Oxygen. Turns out it was plugin issue in the eclipse build that I had.

            Source https://stackoverflow.com/questions/67603653

            QUESTION

            Java iText 5 invalid signature when external signing via MakeSignature.signDeferred
            Asked 2021-May-15 at 15:57

            I am using iText 5 Java for external signing. First I create signature appearance, calculate the hash for signed attributes and leave empty place for the signature. Later when I get the signed hash from client, I insert it the PDF via MakeSignature.signDeferred.

            But PDF reader is showing the signature as invalid. Complaining the PDF has been modified.

            Here is the code used for signing. I have removed a lot of functioning code to keep the code at bare essentials.

            ...

            ANSWER

            Answered 2021-May-15 at 15:52

            The problem was that EmptyContainer.sign method just gives out PDF bytes and not the authenticated attributes. The authenticated attributes are actually which needs to be signed. Thanks mkl for pointing in the right direction.

            I modified EmptyContainer.sign method to create a PdfPKCS7 object and call PdfPKCS7.getAuthenticatedAttributeBytes with PDF hash as one of the arguments.

            After signing the bytes returned by getAuthenticatedAttributeBytes() method and creating CMS container of the signed bytes and the original hash, I was able to successfully sign the PDF.

            Here is the code if someone needs it. It is cluttered all over but you will get the essence.

            Source https://stackoverflow.com/questions/67539405

            QUESTION

            iText: how to add a String to a cell
            Asked 2021-May-08 at 18:48

            Hi guys I am an absolute beginner so go easy on me, why is this not working for me, I really do not understand why this is not working, but I am a beginner so if someone could correct this for me, I would really appreciate it. I am surprised that it does not work

            ...

            ANSWER

            Answered 2021-May-08 at 18:48

            iText 7.0 had a method add(String) for Cell.

            For iText 7.1, as documented in the API, a Cell takes only a block element or an image for its add() method. Block elements in iText are things like paragraphs, lists and divs.

            You can wrap your String in a Paragraph:

            Source https://stackoverflow.com/questions/67450387

            QUESTION

            Cannot import itextpdf 5 in IntelliJ - Maven
            Asked 2021-May-08 at 16:44

            I'm trying to use itextpdf5 but IntelliJ doesn't seem to find the package. I'm using Maven to manage the dependencies and this is what I added to my pom.xml

            ...

            ANSWER

            Answered 2021-May-08 at 16:44

            You cannot import a package like that in Java.

            Import a specific class:

            import com.itextpdf.text.pdf.PdfReader;

            Or import a full package:

            import com.itextpdf.text.pdf.*;

            Source https://stackoverflow.com/questions/67449231

            QUESTION

            iText 7 re-labels by custom name c#
            Asked 2021-May-02 at 09:11

            I found this source code here. My question is how to rename the label by custom name without number. I think this code's row is similar, but without number is my purpose:

            ...

            ANSWER

            Answered 2021-May-02 at 09:05

            For the SetPageLabel method, both the first argument (numbering style) and the second (page label prefix) may be null, in order to omit them from the page labeling style.

            To set a page label without numbering for page 4:

            Source https://stackoverflow.com/questions/67352302

            QUESTION

            Extract PDF metadata using iText Java library
            Asked 2021-Apr-30 at 19:48

            I am trying to get all the XMP metadata stream of a PDF file using the Java library to manipulate PDF files iText. The code I have written is:

            ...

            ANSWER

            Answered 2021-Apr-30 at 19:48

            Unrelated to the issue of getting null, but doc.getXmpMetadata() returns a byte array. So you will not be able to print its content with

            Source https://stackoverflow.com/questions/67323664

            QUESTION

            Setting application/creator metadata with iText7 and htmlpdf
            Asked 2021-Apr-22 at 16:02

            I have been using iText (on .Net) for some time but have only recently started using htmlpdf instead of building the document manually.

            In previous projects I used the following code to set the document metadata:

            ...

            ANSWER

            Answered 2021-Apr-22 at 16:02

            application-name is what you're looking for.

            Source https://stackoverflow.com/questions/67200919

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install itextpdf

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/youzhibing/itextpdf.git

          • CLI

            gh repo clone youzhibing/itextpdf

          • sshUrl

            git@github.com:youzhibing/itextpdf.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link