Skip to content

Tag: pdf

Convert pdf to Postscript using Java

I recently posted a question how to convert a PDF byte[] to Postscript. According to comment, it’s not possible. I was anyway looking into this other question on how to transform a pdf to Postscript. But still cannot get it working. I got my PDF saved already, how would I get an already existing PDF con…

how to change image position to center in PDF android

My app create pdf using this code problem is when user select smaller size image than page size it will move to top left corner i have tried and if image is bigger than page size it goes out of the page I want to shrink the image size to page size Answer I have Changed this image position to

How to read .rpt files in Java and save it as pdf

I have a .rpt file. I want to read it programatically in java and save it in pdf file. I followed the solution multithread pdf conversion My source code provided below After running my code I am unable to read the .rpt file and my pdf file becomes empty. Please help me out. Answer Finally I get a solution usi…

How to open secific range of pages in pdf instead of whole pdf

How to modify the following code to open specific range of pages within the pdf for example from page 5 to 30 instead of opening the whole pdf. Thanks in advance Answer You can’t modify a third party tool, where the option to change the site range programmatically isn’t given. Thus, you can’…

Accessing a COSArray for PDF fields with Apache PDFBox

I’m trying to access all form fields in a PDF file – so I can use code to fill them in – and this is as far as I’ve gotten: which gives an output of: Does anyone know how I can access the two COSObjects in the COSArray? I also don’t know what the notation COSObject{x, y} means, a…

PDFBox 2.0.9 – creating TOC with multiple pages

I’m working on PDF Toc. It generates the first page but when I have more elements I did logic to create a new page for TOC. I’m using PDF Box and that PDPageContentStream. I had to create a function to calculate how many pages I need. Then I’m creating the exact amount of pages in the list a…