Re: simple PDF render differences, SVG and JPG

2024-06-24 Thread Rich Stafford
I am still working on getting the hatched object in a PDF to render when generating SVG, using the SVGGraphics2D output, called from the PDFBox PDFRenderer.renderPageToGraphics() method. I have subclassed SVGGraphics2D class, specifically the fill(Shape s) method. For my PDF hatch data, this m

Re: simple PDF render differences, SVG and JPG

2024-06-24 Thread Tilman Hausherr
Hi, TexturePaint is used for patterns, i.e. rectangles that repeat itself. GetImage() returns a single pattern image. You can test this by saving that BufferedImage with ImageIO.write() and look what's in it. About your problem: the cause is either a bug in Batik, or a missing implementation

Re: simple PDF render differences, SVG and JPG

2024-06-24 Thread Tilman Hausherr
I see you've asked the same question last year?! LOL I think my 2023 answer was better. Tilman - To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org

Re: simple PDF render differences, SVG and JPG

2024-06-24 Thread Rich Stafford
Tilman, Yes, this is the same project from last year. I suspended it in the interim for other priorities. It's still a goal for us, SVG is a much better, scalable representation of many PDF documents. We are getting really close to having it be a good solution. I'm going to experiment with d

Re: simple PDF render differences, SVG and JPG

2024-06-24 Thread Rich Stafford
Tilman, The TIlingPaint object has attributes of a TexturePaint and a PatternMatrix. In my case, the TexturePaint has a BufferedImage, and four attributes: sx, sy (values 0.2439,0.2439) and tx, ty (values 0.0,0.0). The PatternMatrix is just an identity matrix. I can get the Rectangle2D for t

Re: simple PDF render differences, SVG and JPG

2024-06-24 Thread Tilman Hausherr
Hi, There's also XStep and YStep that matter. I can't tell you the actual increments. You should trace through the code. > Is there an example in the PDFBox code that draws a pattern when outputting to renderImageWithDpi() Isn't your PDF such an example? Alternatively create a PDF that uses

Re: PDFBox bug report: PDDocument.load(inputFile) crashes when parsing malformed ItalicAngle

2024-06-24 Thread Lucky Python
Hi Tilman, is this bug accepted? Any additional info needed? Thanks! On Sat, May 25, 2024 at 11:53 AM Lucky Python wrote: > Thanks for the reply! > > I'd expect PDFBox to gracefully handle it instead of crashing, kinda like > https://issues.apache.org/jira/browse/PDFBOX-3500. > > The example PDF

Re: PDFBox bug report: PDDocument.load(inputFile) crashes when parsing malformed ItalicAngle

2024-06-24 Thread Tilman Hausherr
Hi, This was fixed on the same day in https://issues.apache.org/jira/browse/PDFBOX-5829 You can try a snapshot: https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.3-SNAPSHOT/ https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app

Re: simple PDF render differences, SVG and JPG *solved*

2024-06-24 Thread Rich Stafford
Tilman, It turns out to be a trivial piece of code to get patterns to render properly when generating SVG. I had to add a class, 'eqSVGGraphics' to superclass the SVGGraphics2D module, and then override the fill(Shape s) method. I've attached my eqSVGGraphics.java module to show you what I did

Re: simple PDF render differences, SVG and JPG *solved*

2024-06-24 Thread Tilman Hausherr
Hi, Please test files from https://issues.apache.org/jira/browse/PDFBOX-1094  to see if this works for more than one file and if these patterns are at the correct position. Tilman On 24.06.2024 20:01, Rich Stafford wrote: Tilman, It turns out to be a trivial piece of code to get patterns t

Re: simple PDF render differences, SVG and JPG *solved*

2024-06-24 Thread Rich Stafford
Tilman, I looked at gs-bugzilla691715.pdf, and there are some differences between the .renderPageToGraphics() and .renderImageWithDPI() results. I think the differences are in rotation of the patterns. For instance the 'red' vertical lines are horizontal dashes, and the 'blue' screen is blue

Very slow on-disk font cache population on Windows with PDFBox 2.0.31

2024-06-24 Thread Adam Rauch
Greetings, We use PDFBox alongside Tika to support full-text search indexing and querying. Our Windows test agents (fairly powerful AWS instances) began timing out many tests after we upgraded PDFBox from 2.0.29 to 2.0.31. We tracked the problem down to the on-disk font cache population proces

Re: Very slow on-disk font cache population on Windows with PDFBox 2.0.31

2024-06-24 Thread Tilman Hausherr
Hi, There was a poorly thought change that made it all slower (using an SHA512 checksum for each font) but that was fixed (much faster checksum method, because this isn't crypto so CRC32 is enough) in 2.0.31 https://issues.apache.org/jira/browse/PDFBOX-5727 I don't know anything about AWS, a

How to merge two pdf pages in to single Page

2024-06-24 Thread Semmalai C
Dear All, i have two pdf files first.pdf and second.pdf . need to copy the content of first page of the second.pdf to the last page of first.pdf. assume in the last page of first.pdf has some content . same portion the second.pdf has no content. Need to get the content stream ,resources of firs