pdfbox

PDFbox Preflight PDF/A-1b check not working properly in java version 1.8

半腔热情 提交于 2019-12-11 03:56:37
问题 I am using PDFBOX Preflight to validate pdf document to check whether it is in PDF/A-1b format or not . It works perfectly on java 1.7 but when I run the code in java 1.8 i get following errors 2.4.3 : Invalid Color space, DestOutputProfile is missing 2.4.3 : Invalid Color space, DestOutputProfile is missing 2.4.3 : Invalid Color space, DestOutputProfile is missing 7.11 : Error on MetaData I am using pdfbox 1.8.8 and preflight 1.8.3 Following is the code that I am using for validating the

“Lock” dictionary in signature field is the reason of broken signature after signing

不羁岁月 提交于 2019-12-11 03:52:35
问题 In PDFBox 2.x I put /Lock dictionary to signature field: import org.apache.pdfbox.cos.COSDictionary; import org.apache.pdfbox.cos.COSName; import org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm; import org.apache.pdfbox.pdmodel.interactive.form.PDSignatureField; public class SigningUtils { public static final COSName COS_NAME_LOCK = COSName.getPDFName("Lock"); public static final COSName COS_NAME_ACTION = COSName.getPDFName("Action"); public static final COSName COS_NAME_ALL = COSName

Clip and create new pdf from existing pdf with page numbers as input - pdfbox

冷暖自知 提交于 2019-12-11 02:54:54
问题 I have a pdf file with 10 pages, I need to clip the pages from 2 to 5 and create a new pdf. What I am doing is like the following: PDDocument pddDocument=PDDocument.load(new File("sample.pdf")); PDFTextStripper textStripper=new PDFTextStripper(); String text = textStripper.getText(pddDocument).toString(); I am simply reading the pdf file and writing into a new file. How can clip with upper and lower bound as page numbers? Please guide me? 回答1: This solution (for PDFBox 1.8.*) creates a PDF

Get rid of blurred chart when saving it to a pdf

人盡茶涼 提交于 2019-12-11 02:48:05
问题 So I found an example on the internet how to save a javafx chart to a pdf, so I tried it out: final AreaChart<Number, Number> arechart = new AreaChart<>(new NumberAxis(0, 3, 0.5), new NumberAxis(0, 3, 0.5)); xAxis.setLabel("average quality"); yAxis.setLabel("average quantity"); sc.setTitle("Producerdata"); XYChart.Series series1 = new XYChart.Series(); series1.setName("Water 11"); producer.getProducts().forEach((pr) -> { if (pr.getName().equals("Water 11")) { series1.getData().add(new XYChart

PDF document is modified by another revision?

南楼画角 提交于 2019-12-11 01:52:11
问题 I use PDFbox in order to sign PDF. It works very well. I can add several signature to one document, and everything works well. Now, someone sign me a document(she sign by another software), this signature was working too. but when I add another revision (by pdfbox) to his document now Adobe reader tells me that PDF was modified. that is original document: this this is signed document which was done by another software: link when I add another revision to the signed pdf, I get this document,

PDFBox not recognising pdf to be non printable

社会主义新天地 提交于 2019-12-11 01:30:27
问题 I am using PDFBox for validating a pdf document and one of the validation states that whether the pdf document is printable or not. I use the following code to perform this operation: PDDocument document = PDDocument.load("<path_to_pdf_file>"); System.out.println(document.getCurrentAccessPermission().canPrint()); but this is returning me true though when the pdf is opened, it shows the print icon disabled. 回答1: Access permissions are integrated into a document by means of encryption. Even PDF

PDFBox 2.0.4 : XFA to text error

♀尐吖头ヾ 提交于 2019-12-11 01:19:43
问题 I am getting the following errors while trying to convert PDF(XFA) to string. These errors started coming when I switched from PDFBox 1.8.12 to PDFBox 2.0.4 Here is the log Mar 09, 2017 7:16:07 AM org.apache.pdfbox.pdfparser.BaseParser parseCOSArray WARNING: Corrupt object reference at offset 779916 Mar 09, 2017 7:16:07 AM org.apache.pdfbox.pdfparser.BaseParser parseCOSArray WARNING: Corrupt object reference at offset 780049 Mar 09, 2017 7:16:07 AM org.apache.pdfbox.pdfparser.BaseParser

U+0151 ('odblacute') is not available in this font Times-Roman encoding: WinAnsiEncoding

允我心安 提交于 2019-12-11 00:55:09
问题 I'm trying to set some text ( classical Hungarian dummy: árvíztűrő tükörfúrógép ): contentStream.showText(text); method with PDFBOX 2.0.7,and i got U+0151 ('odblacute') is not available in this font Times-Roman encoding: WinAnsiEncoding for őűŐŰ characters with all PDType1Font types. Other accented characters are working. Can anyone help me? Thanx a lot! 回答1: Well yes, "ő" is not available in WinAnsiEncoding. As explained in the FAQ: to see what WinAnsiEncoding is, look at the PDF

Apache PDFBox rotate PDImageXObject

你。 提交于 2019-12-10 21:36:57
问题 I'm playing around with the 2.0.0-SNAPSHOT, and I want to set the page to landscape and also rotate my picture. So I've done page.setRotation(90); There seems to be a bug with using PDFBox and AffineTransform This code doesn't do anything like I'd expect: AffineTransform at = new AffineTransform(w, 0, 0, h, 20, 20); at.translate(0.5, 1); at.rotate(Math.toRadians(90)); Width and Height have to be tiny to keep the image on the page, rotate by itself squishes the image, and translate before

PDFBox outputs question marks instead of some Japanese characters

谁说我不能喝 提交于 2019-12-10 21:22:00
问题 From almost all pdf files written in Japanese, I got correct text with Apache Tika(1.7) and Apache PDFBox(1.8.8). Now I have a trouble with a pdf file which i cannot upload it here by business reason. problem All Japanese characters in a paragraph becomes "?", but in other paragraphs, Japanese characters are correct. in any case, ASCII chars are correct. PDF file All Japanese characters in the PDF document are seems to be correct in Adobe Acrobat on my Windows7 desktop. from Adobe Acrobat