Free Support Forum -

Where is com.aspose.pdf.Document

where is com.aspose.pdf.Document,I have read the example

Add Image in an Existing PDF File

in the Programmers Guide,that is :

//open first document
com.aspose.pdf.Document pdfDocument1 = new com.aspose.pdf.Document("input.pdf");
//set coordinates
int lowerLeftX = 100;
int lowerLeftY = 100;
int upperRightX = 200;
int upperRightY = 200;

//get the page where image needs to be added
com.aspose.pdf.Page page = pdfDocument1.getPages().get_Item(1);
//load image into stream  imageStream = new"input_image1.jpg"));
//add image to Images collection of Page Resources
//using GSave operator: this operator saves current graphics state
page.getContents().add(new com.aspose.pdf.Operator.GSave());
//create Rectangle and Matrix objects
com.aspose.pdf.Rectangle rectangle = new com.aspose.pdf.Rectangle(lowerLeftX, lowerLeftY, upperRightX, upperRightY);
com.aspose.pdf.Matrix matrix = new com.aspose.pdf.Matrix(new double[] { rectangle.getURX() - rectangle.getLLX(), 0, 0, rectangle.getURY()- rectangle.getLLY(), rectangle.getLLX(), rectangle.getLLY() });
//using ConcatenateMatrix (concatenate matrix) operator: defines how image must be placed
page.getContents().add(new com.aspose.pdf.Operator.ConcatenateMatrix(matrix));
com.aspose.pdf.XImage ximage = page.getResources().getImages().get_Item(page.getResources().getImages().size());
//using Do operator: this operator draws image
page.getContents().add(new com.aspose.pdf.Operator.Do(ximage.getName()));
//using GRestore operator: this operator restores graphics state
page.getContents().add(new com.aspose.pdf.Operator.GRestore());
// save the newly generated PDF file"Updated_document.pdf");

// close image stream
But I can't find the the java package of com.aspose.pdf in the Aspose.Pdf for Java for free trials


Thanks for contacting support.

We have recently ported Aspose.Pdf for .NET to Java platform and currently we are busy testing the new release version. Please note that the new Auto-ported version of Aspose.Pdf for Java will contain com.aspose.pdf.Document class. However if you need to add an image to existing PDF file, you may try using PdfFileMend class present in Aspose.Pdf.Kit for Java. For further details, please visit Adhere Image

As soon as we have completed the testing of Auto-ported version and new release becomes available, we would be more than happy to update you with the status of correction. We are really sorry for this confusion and inconvenience that you have faced in this regard.

I would like to ask, if the licenced version contains the com.aspose.pdf.Document class?


The trial version offers the same set of features as provided in licensed version, except for the fact that the output files generated with trial mode contain an evaluation watermark which does not appear when using a valid license file.

So once the new Auto-ported version becomes available, the Document class will be available in licensed as well as trial version.


Thanks for your patience.

I am pleased to share that an autoported MergedAPI version of Aspose.Pdf for Java 4.0.0 has been released. Please try using the latest release version and in case you encounter any issue or you have any related query, please feel free to contact.