pdf

Printing PDF directly using PrintManager Android 4.4

放肆的年华 提交于 2020-08-04 15:27:08
问题 http://developer.android.com/training/printing/index.html documentation tells how to print a custom content by rendering it on a PDF canvas and sending thus created PDF document for printing. But has no information about if we already have a PDF document, how to send it for printing? Does similar to bitmap printing, there is some method like printHelper.printPDF? 回答1: Use the following code fragment in your onWrite() method should do it: InputStream input = null; OutputStream output = null;

Digital signatures using itext 5.5.5

陌路散爱 提交于 2020-08-04 06:07:05
问题 I upgraded from iText 5.2.1 to iText 5.5.5 I was using PdfStamper along with PdfSignatureApperance to apply digital signatures. Here is my snippet of code. PdfStamper stamper = PdfStamper.createSignature(reader, byteArrayOutputStream,'\0'); PdfSignatureAppearance appearance = stamper.getSignatureAppearance(); appearance.setCrypto(key, chain, null, PdfSignatureAppearance.WINCER_SIGNED); From the above code, there are couple of things which are not present in the current version. 1) In version

PDFBox U+00A0 is not available in this font's encoding

≯℡__Kan透↙ 提交于 2020-08-04 04:24:57
问题 I am facing a problem when invoking the setValue method of a PDField and trying to set a value which contains special characters. field.setValue("TEST-BY (TEST)") In detail, if my value contains characters as U+00A0 i am getting the following exception: Caused by: java.lang.IllegalArgumentException: U+00A0 is not available in this font's encoding: WinAnsiEncoding A complete stracktrace can be found here: Stacktrace I currently have set PDType1Font.TIMES_ROMAN as font. In order to solve this

PDFBox U+00A0 is not available in this font's encoding

倾然丶 夕夏残阳落幕 提交于 2020-08-04 04:24:51
问题 I am facing a problem when invoking the setValue method of a PDField and trying to set a value which contains special characters. field.setValue("TEST-BY (TEST)") In detail, if my value contains characters as U+00A0 i am getting the following exception: Caused by: java.lang.IllegalArgumentException: U+00A0 is not available in this font's encoding: WinAnsiEncoding A complete stracktrace can be found here: Stacktrace I currently have set PDType1Font.TIMES_ROMAN as font. In order to solve this

Excel VBA to return Page Count from protected PDF file

微笑、不失礼 提交于 2020-07-24 05:48:53
问题 I need to retrieve the number of pages in PDF files (with security ), using Excel VBA. The following code works when there is no security enabled in the PDF file: Sub PDFandNumPages() Dim Folder As Object Dim file As Object Dim fso As Object Dim iExtLen As Integer, iRow As Integer Dim sFolder As String, sExt As String Dim sPDFName As String sExt = "pdf" iExtLen = Len(sExt) iRow = 1 ' Must have a '\' at the end of path sFolder = "C:\test\" Set fso = CreateObject("Scripting.FileSystemObject")

Excel VBA to return Page Count from protected PDF file

人走茶凉 提交于 2020-07-24 05:47:49
问题 I need to retrieve the number of pages in PDF files (with security ), using Excel VBA. The following code works when there is no security enabled in the PDF file: Sub PDFandNumPages() Dim Folder As Object Dim file As Object Dim fso As Object Dim iExtLen As Integer, iRow As Integer Dim sFolder As String, sExt As String Dim sPDFName As String sExt = "pdf" iExtLen = Len(sExt) iRow = 1 ' Must have a '\' at the end of path sFolder = "C:\test\" Set fso = CreateObject("Scripting.FileSystemObject")

Excel VBA to return Page Count from protected PDF file

夙愿已清 提交于 2020-07-24 05:46:51
问题 I need to retrieve the number of pages in PDF files (with security ), using Excel VBA. The following code works when there is no security enabled in the PDF file: Sub PDFandNumPages() Dim Folder As Object Dim file As Object Dim fso As Object Dim iExtLen As Integer, iRow As Integer Dim sFolder As String, sExt As String Dim sPDFName As String sExt = "pdf" iExtLen = Len(sExt) iRow = 1 ' Must have a '\' at the end of path sFolder = "C:\test\" Set fso = CreateObject("Scripting.FileSystemObject")

Excel VBA to return Page Count from protected PDF file

谁说胖子不能爱 提交于 2020-07-24 05:45:09
问题 I need to retrieve the number of pages in PDF files (with security ), using Excel VBA. The following code works when there is no security enabled in the PDF file: Sub PDFandNumPages() Dim Folder As Object Dim file As Object Dim fso As Object Dim iExtLen As Integer, iRow As Integer Dim sFolder As String, sExt As String Dim sPDFName As String sExt = "pdf" iExtLen = Len(sExt) iRow = 1 ' Must have a '\' at the end of path sFolder = "C:\test\" Set fso = CreateObject("Scripting.FileSystemObject")

Search texts and get position in pdf with java

安稳与你 提交于 2020-07-23 06:55:06
问题 How can I search for text and get position in pdf with java ? I tried with apache pdfbox and pdfclown but whenever the text goes down or start a new paragraph, it doesn't work. I want to get the same result like in the picture below. Thank you. Desired result 回答1: You referred to one of my earlier answers as an example for PDFBox which did not work for you. Indeed, as already explained in that answer it was a surprise to see that code match anything beyond single words as the callers of the

Search texts and get position in pdf with java

自作多情 提交于 2020-07-23 06:54:06
问题 How can I search for text and get position in pdf with java ? I tried with apache pdfbox and pdfclown but whenever the text goes down or start a new paragraph, it doesn't work. I want to get the same result like in the picture below. Thank you. Desired result 回答1: You referred to one of my earlier answers as an example for PDFBox which did not work for you. Indeed, as already explained in that answer it was a surprise to see that code match anything beyond single words as the callers of the