How can I create a document with custom page size using docx4j. I have searched over the net and able to find that we can create the page size available in PageSizePaper ENUM only....Please help me out to create the doc with custom page size..
Hello World invokes WordprocessingMLPackage.createPackage()
If you follow that code, you'll see at https://github.com/plutext/docx4j/blob/master/src/main/java/org/docx4j/openpackaging/packages/WordprocessingMLPackage.java#L445 that you need a PgSz object.
You can use the docx4j webapp or Helper AddIn on a docx where you have set a custom page size (ie in Word) to see what that code would look like. Here is an example:
SectPr.PgSz sectprpgsz = wmlObjectFactory.createSectPrPgSz();
sectpr.setPgSz(sectprpgsz);
sectprpgsz.setH( BigInteger.valueOf( 16838) );
sectprpgsz.setW( BigInteger.valueOf( 11906) );