天道酬勤,学无止境

pdf

JasperReports: how to display report in JSP page?

How to display jasper reports in JSP page? I am using iReport 1.3.3 tool to create reports. I am able to create reports but I am struggling to display that report in JSP page. Note: I need to display the report in PDF and Excel format.

2021-10-27 02:36:38    分类:问答    excel   jsp   pdf   jasper-reports

PHP Filter FlateDecode PDF stream returning offset characters

I have code that extracts text from a PDF using a filetotext class. Worked until last week when something changed in the pdf's being generated. Weird thing is that it appears the characters are there and correct once I add 29 to the ord of the character. Example response debug printout: /F1 7.31 Tf 0 0 0 rg 1 0 0 1 195.16 597.4 Tm ($PRXQW)Tj ET BT The code uses gzuncompress on the stream section of the pdf. The $PRXQW is Amount, and adding 29dec to the ord of each character gives me this. But sometimes a character will not be this exact translation, such as what should be a ) in the text

2021-10-27 02:20:12    分类:问答    php   pdf   character-encoding   text-extraction

PDF 内容流“TJ/Tj”拆分而不弄乱剩余的文本矩阵?(PDF content stream "TJ /Tj" split without messing the remaining text matrices?)

问题 我想使用 PDFBOX 拆分 TJ/Tj 运算符的 COSString。 我的 pdf 当前内容流如下所示。 期望输出 或者 我试过什么? public static void SplitTj_TJ(int tj_ind, PDDocument document) throws IOException{ PDPage page = document.getPage(0); PDFStreamParser parser = new PDFStreamParser(page); parser.parse(); List tokens = parser.getTokens(); Operator op = (Operator) tokens.get(tj_ind); COSFloat dest_x = new COSFloat((float) 90.81199646); COSFloat dest_y = new COSFloat((float) 0); if ( tokens.get(tj_ind) instanceof Operator && (op.getName().equals("TJ") || op.getName().equals("Tj"))){ COSArray tj_array = (COSArray) tokens.get(tj_ind-1); tokens

2021-10-27 02:19:06    分类:技术分享    pdf   pdfbox

Java:使用 ghost4j 将 PDF 转换为图像(Java: convert PDF to image using ghost4j)

问题 我正在尝试使用ghost4j库将 pdf 转换为图像。 我的代码如下所示: import org.ghost4j.document.*; import org.ghost4j.renderer.*; import java.util.ArrayList; import java.util.List; . . . PDFDocument document = new PDFDocument(); document.load(new File("M:\\test.pdf")); SimpleRenderer renderer = new SimpleRenderer(); renderer.setResolution(300); List<Image> images = renderer.render(document); 但我收到以下错误: 错误:找不到符号列表图像 = renderer.render(document); ^ 符号:class 图片位置:class ImageRead 1 错误 这表明编译器找不到符号“Image”。 我不确定为什么?

2021-10-27 02:02:41    分类:技术分享    java   image   pdf   ghost4j

Translate GPS coordinates to location on PDF Map

I'd like to know (from a high level view) what would be required to take a pdf floor plan of a building and determine where exactly you are on that floor plan using GPS coordinates? In addition to location, the user would be presented with a "turn by turn" directions to another point on the map, navigating down hallways, between cubicles, etc. Use case: an iPhone app that determined a user's location and guided them to a conference room or person's office in the building. I realize that this is by no means trivial, but any help is appreciated. Thanks!

2021-10-27 01:47:34    分类:问答    iphone   pdf   gps   maps

create multiple folders using existing file names in linux

i have downloaded several pdf files(with various names) and stored them in a specific directory (for example, Downloads/directory1). i would like to create folders to store these files under the same directory, using the names of the original files, but without the extension pdf. for example, for a file named maths.pdf, i want to create the folder maths and store the pdf in it. i made several attempts creating a script using commands as basename and for, but i didn't have any luck.

2021-10-27 00:31:32    分类:问答    bash   pdf   mkdir

PDFMerger in loop

Can you guys help me, I try to merge a pdf file with PDFMerger, this is the sample code : $pdf->addPDF('samplepdfs/one.pdf', '1, 3, 4') ->addPDF('samplepdfs/two.pdf', '1-2') ->addPDF('samplepdfs/three.pdf', 'all') ->merge('browser', 'samplepdfs/TEST2.pdf'); and how do I put the 'addPDF('samplepdfs/filename.pdf', '1-2')' in loop, so I can merge many pdf files in php dynamically ?

2021-10-26 23:30:16    分类:问答    php   loops   pdf

Headless LibreOffice 在 Windows 上导出 PDF 的速度非常慢(比 Linux 慢 6 倍)(Headless LibreOffice very slow to export to PDF on Windows (6 times slow than on Linux))

问题 我经常需要使用 LibreOffice 将许多 (> 1000) .docx 文档导出为 PDF。 这是一个示例文档:test.docx。 以下代码有效,但在 Windows 上运行速度很慢(每个 PDF 文档平均为 3.3 秒): import subprocess, docx, time # first do: pip install python-docx for i in range(10): doc = docx.Document('test.docx') for paragraph in doc.paragraphs: paragraph.text = paragraph.text.replace('{{num}}', str(i)) doc.save('test%i.docx' % i) # these 4 previous lines are super fast - a few ms t0 = time.time() subprocess.call(r'C:\Program Files\LibreOffice\program\soffice.exe --headless --convert-to pdf test%i.docx --outdir . --nocrashreport --nodefault --nofirststartwizard -

2021-10-26 23:25:44    分类:技术分享    python   pdf   docx   libreoffice

how to pass Image data uri from javascript to php

I have a webpage which displays a chart. I had to generate a pdf of this chart. So I wrote this code to capture the chart as an image and put inside the pdf. I used html2canvas for this which generated a data uri for the image. Now I am stuck with this uri in javascript. The pdf code is a php script which needs this uri. How do I do this ? The chart.php generates the chart and using html2canvas stores the image datatauri into localstorage. CHART.PHP <script> //<![CDATA[ (function() { window.onload = function(){ html2canvas(document.getElementById('chart'), { "onrendered": function(canvas) {

2021-10-26 23:07:54    分类:问答    javascript   php   html   ajax   pdf

在 Python 中迭代 XML 时如何获取前面的元素?(How to take preceding element when iterating over XML in Python?)

问题 我有一个这样结构的 XML: <?xml version="1.0" encoding="utf-8"?> <pages> <page id="1" bbox="0.000,0.000,462.047,680.315" rotate="0"> <textbox id="0" bbox="179.739,592.028,261.007,604.510"> <textline bbox="179.739,592.028,261.007,604.510"> <text font="NUMPTY+ImprintMTnum" bbox="191.745,592.218,199.339,603.578" ncolour="0" size="12.482">C</text> <text font="NUMPTY+ImprintMTnum-it" bbox="191.745,592.218,199.339,603.578" ncolour="0" size="12.333">A</text> <text font="NUMPTY+ImprintMTnum-it" bbox="192.745,592.218,199.339,603.578" ncolour="0" size="12.333">P</text> <text font="NUMPTY+ImprintMTnum-it" bbox=

2021-10-26 21:15:41    分类:技术分享    python   xml   pdf   xpath   tree