currently i am working on pdftron APi on Android . I have added an image in pdf doc what i need now that when the user click or long press the image it shows the text "Remove image" and on selecting that the added image can be removed .I have used the following code to add the image at pdf document
public void processCameraResult(PDFDoc doc, Bitmap bitmap)
{
try
{
ElementBuilder elementBuilder = new ElementBuilder();
ElementWriter writer = new ElementWriter();doc.lock();
Page page = doc.pageCreate(); // Create a new page
writer.begin(page); // Begin writing to this page
Image img = Image.create(doc.getSDFDoc(), bitmap);
//Element element = elementBuilder.createImage(img,new Matrix2D(img.getImageWidth(), 0, 0, img.getImageHeight(),100, 450));
Element element = elementBuilder.createImage(img,new Matrix2D(img.getImageWidth(), 0, 0, img.getImageHeight(),150, 450));
writer.writePlacedElement(element); // Write the graphic image to page
writer.end(); // Save the pagedoc.pagePushBack(page); // Add the page to the document page sequence
doc.save(SDFDoc.e_linearized, null); // Update the doc with the image
doc.unlock(); // unlock docmPDFView.updatePageLayout(); // Update the Page Layout after change
mPDFView.setDoc(doc); // Update the view with the new appended document
}
catch (PDFNetException exception)
{
handleException(exception, "processCameraResult", "E1032");
}
catch (InterruptedException exception)
{
handleException(exception, "processCameraResult", "E1033");
}}