Create a pdf with dimensions 1700pixels*2200pixels in java using pdfBox -


I have an application that opens a PDF file with dimension 1700 pixels * 2200 pixels I get it on a PDF Dimension of drawn rectangle will be found. When I'm trying to make the same rectangle on a PDF, I am using PDF, which creates a PDF page with dimensions.

  System.out.println (page .getMediaBox (). GetHeight ()); Println (page.getMediaBox () getWidth ().); Results in 

:

  612 792   

PDF coordinates 1700 * 2200 to 612 * 792?

your output

  612 792   

of

  System.out.println (page .getMediaBox (.) GetHeight ()); Println (page.getMediaBox () getWidth ().);   

It seems that you make that PDPage by using the default constructor, i.e. using new PDPage () Set the Constructor Page size in the US Letter page format.

If you want a page in a different format, then you should use the constructor PDPage (PDRectangle) , such as:

  PDRectangle rec = New PDRactengel (1700, 2200); PDDocument document = new PDDocument (); PDFs = new PDFs (REC); Document.addPage (page);   

This creates a PDF with the page that has size 1700x2200 user space units, i.e. 23.6 "x30.6"

BTW, you do not know a PDF file in 1700 pixels * 2200 pixels dimensions - do not know the PDF unit 'pixel' They know the default user space unit which is 1/72 Default ", and therefore more than or equal to the unit point. This does not specifically indicate a resolution.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -