pdfbox

Pdf to image using java

非 Y 不嫁゛ 提交于 2021-02-08 11:09:01
问题 Good day fellow programmer. I'm new to java, and I need to create an Image from a specific part of a pdf. Currently, I'm using pdfbox. Here is my code to create an image from a pdf (it's working but it creates an image of the whole pdf page): PDDocument document = PDDocument.load(new File(PDFFILE)); PDFRenderer pdfRenderer = new PDFRenderer(document); for (int page = 0; page < document.getNumberOfPages(); ++page) { BufferedImage bim = pdfRenderer.renderImageWithDPI(page, 300, ImageType.RGB);

Pdf to image using java

别来无恙 提交于 2021-02-08 11:07:26
问题 Good day fellow programmer. I'm new to java, and I need to create an Image from a specific part of a pdf. Currently, I'm using pdfbox. Here is my code to create an image from a pdf (it's working but it creates an image of the whole pdf page): PDDocument document = PDDocument.load(new File(PDFFILE)); PDFRenderer pdfRenderer = new PDFRenderer(document); for (int page = 0; page < document.getNumberOfPages(); ++page) { BufferedImage bim = pdfRenderer.renderImageWithDPI(page, 300, ImageType.RGB);

Accessing “alternate text” for an image via PDFBox

巧了我就是萌 提交于 2021-02-07 20:02:15
问题 Is there some way to extract "alternate text" for a specific image using PDFBox? I have a PDF file which, as described at http://www.w3.org/WAI/GL/2011/WD-WCAG20-TECHS-20110621/pdf.html#PDF1, has had alternate text added to an image. Using PDFBox I can find my way through the object model to the image itself (a PDXObjectImage) through PDFDocument.getDocumentCatalog().getAllPages() [iterator] .getResources.getImages() but I can not see any way to get from the image itself to the alternate text

Accessing “alternate text” for an image via PDFBox

匆匆过客 提交于 2021-02-07 20:00:57
问题 Is there some way to extract "alternate text" for a specific image using PDFBox? I have a PDF file which, as described at http://www.w3.org/WAI/GL/2011/WD-WCAG20-TECHS-20110621/pdf.html#PDF1, has had alternate text added to an image. Using PDFBox I can find my way through the object model to the image itself (a PDXObjectImage) through PDFDocument.getDocumentCatalog().getAllPages() [iterator] .getResources.getImages() but I can not see any way to get from the image itself to the alternate text

Adding fonts to Apache Pdfbox?

只愿长相守 提交于 2021-02-07 11:57:37
问题 Is there a way to add additional font styles into Apache Pdfbox? We're currently trying to work around printing PDFs in our system (currently being done with PDF-Renderer.) I have been looking at various alternatives (pdfbox, jpedal, jPDFPrint) Our hope is for a free GPL compatible library to use, and as such we're leaning towards pdfbox. I have been able to write some sample code to print out the pdf which 'works'. See below: PDDocument doc; try { doc = PDDocument.load("test.pdf"); doc.print

PDFBox not supporting multiple languages

爷,独闯天下 提交于 2021-02-07 10:29:25
问题 I'm trying to generate a PDF report consisting sentences in multiple languages. For that I'm using Google NOTO fonts but google CJK fonts doesn't support some of the Latin special characters due to that my PDF box is failing to generate a report or sometime shows weird characters. Any one has any appropriate solution ? I tried multiple things but unable to find a single TTF file that can support all Unicode. I also tried fallback to different font file but that will be too much work.

PDFBox not supporting multiple languages

纵饮孤独 提交于 2021-02-07 10:28:34
问题 I'm trying to generate a PDF report consisting sentences in multiple languages. For that I'm using Google NOTO fonts but google CJK fonts doesn't support some of the Latin special characters due to that my PDF box is failing to generate a report or sometime shows weird characters. Any one has any appropriate solution ? I tried multiple things but unable to find a single TTF file that can support all Unicode. I also tried fallback to different font file but that will be too much work.

PDFBox not supporting multiple languages

China☆狼群 提交于 2021-02-07 10:27:17
问题 I'm trying to generate a PDF report consisting sentences in multiple languages. For that I'm using Google NOTO fonts but google CJK fonts doesn't support some of the Latin special characters due to that my PDF box is failing to generate a report or sometime shows weird characters. Any one has any appropriate solution ? I tried multiple things but unable to find a single TTF file that can support all Unicode. I also tried fallback to different font file but that will be too much work.

Sign pdf asynchronously using digest

痴心易碎 提交于 2021-02-06 09:32:46
问题 I'm trying to do the following setup for signing pdfs, broken down into asynchronous steps between a client and a server: A server receives a pdf and computes it's digest. Server sends the digest to a client. Client signs the hash at a later time. Client sends the signature to server. Server embeds the signature into the pdf. I'm basing myself mainly in PDF Signature digest and Create pkcs7 signature from file digest The second question allowed me to write most of the code, however I'm

Sign pdf asynchronously using digest

只愿长相守 提交于 2021-02-06 09:32:10
问题 I'm trying to do the following setup for signing pdfs, broken down into asynchronous steps between a client and a server: A server receives a pdf and computes it's digest. Server sends the digest to a client. Client signs the hash at a later time. Client sends the signature to server. Server embeds the signature into the pdf. I'm basing myself mainly in PDF Signature digest and Create pkcs7 signature from file digest The second question allowed me to write most of the code, however I'm