Convert a text file to pdf in java
Add a comment. Active Oldest Votes. The iText approach is the right one. You can do something like this : import java. PageSize for a complete list of page-size constants. Thanks for the answers and I hope this helps someone in the future!
A PDF is a binary object. You need to write the bytes directly to a file. Greg 8, 6 6 gold badges 47 47 silver badges 89 89 bronze badges. It does not have those flags, it's just text in between XML tags. Can you post the first few lines and last few so we can see? Once I decoded out of Base64 those tags there there, thanks for your help! Test Nr. This is the last line. The resulting output looks like: Test Customer Can anyone help to understand why the blanks are not shown in the resulting PDF?
Regards, Ralf Hi mkl, Thanks for reponding. Note: If I use System. Seems to be that the iText document. Regards, Ralf. Try and replace the space characters 0x20 by non-breaking space characters 0xA0.
Do you have an idea why I have an extra line after each line? Is it possible that those "extra lines" are not actually independent lines but instead large leading values for the paragraphs? Add a comment. Active Oldest Votes. If you add each of your lines as a separate paragraph, therefore, you'll get that extra space.
If on the other hand you add a single paragraph containing all of your lines, you don't get that extra space between your lines. As you suggested, adding the lines to a single paragraph and than adding this paragraph solves my problems. It provides important features for integrating PDF functionality in Java applications or products. It helps you to create a smart document workflow. Document workflow is a very important process in a company. Data always play a key role the success of an organization.
That can help you to save time as well as money. Words Product Solution Aspose. Cells Product Solution Aspose. Email Product Solution Aspose. Slides Product Solution Aspose. Imaging Product Solution Aspose. BarCode Product Solution Aspose. Diagram Product Solution Aspose. Tasks Product Solution Aspose. Note Product Solution Aspose. Page Product Solution Aspose.
0コメント