Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in pdfProcessor when the PageSize starting y axis differs from zero? #72

Closed
bellaz89 opened this issue Nov 6, 2019 · 1 comment
Closed

Comments

@bellaz89
Copy link

bellaz89 commented Nov 6, 2019

Here it is some example (scala) code

import java.awt.BasicStroke
import java.awt.geom.Rectangle2D
import java.io._
import de.erichseifert.vectorgraphics2d._
import de.erichseifert.vectorgraphics2d.util._

object MainTest {

	def main(args: Array[String]): Unit = {
		val vg2d = new VectorGraphics2D()
		vg2d.setStroke(new BasicStroke(2.0f))
		vg2d.drawRect(-5, -5, 10, 10)
		val commands = vg2d.getCommands()
		val pdfProcessor = Processors.get("pdf")
		val svgProcessor = Processors.get("svg")

		val doc1 = pdfProcessor.getDocument(commands, new PageSize(-10,-10,20,20))
		doc1.writeTo(new FileOutputStream("rect.pdf"))
		
		val doc2 = svgProcessor.getDocument(commands, new PageSize(-10,-10,20,20))
		doc2.writeTo(new FileOutputStream("rect.svg"))

	}
}

The generated pdf:
rect
rect.pdf

The generated svg (converted to jpg):
rect

So the pdfProcessor seems to ignore the 'y' argument of PageSize..

@eseifert
Copy link
Owner

Thanks @bellaz89! This definitely looks like a bug with page coordinates in PDFDocument and should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants