Free Support Forum - aspose.com

addStamp

Evaluating Aspose.PDF 10.3 for inclusion in a product. Stand-alone it is working fine. But when we bundle it with an Oracle product it throws a null exception. We have tried 9.5 as well. Below is the stack trace. If nothing comes to mind we move on to the next watermarking candidate. Would be a shame as we like and have purchased Word and Cells.





<2015-06-08 22:41:33,862>ERROR Unable to watermark 3000700 / Engineering-Drawing-2.pdf. null

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p359.z32.m1(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p361.z2.m1(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p574.z2.m7(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p574.z2.m4(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p575.z2.m2(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p575.z2.(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p576.z1.m4(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p576.z7.(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p576.z1.(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p576.z3.(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p575.z8.m1(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p578.z27.m28(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p578.z32.m1(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p578.z27.m1(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p579.z1.m1(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p580.z1.m1(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.internal.p580.z1.m1(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.TextStamp.put(Unknown Source)

<2015-06-08 22:41:33,862>ERROR com.aspose.pdf.Page.addStamp(Unknown Source)

Hi Steve,


Thanks for your inquiry. We will appreciate it if you please share working environment of your both scenarios, standalone test and bundled with Oracle product. Moreover, please share some details along with sample code of your test, when bundled Aspose.Pdf with Oracle product. So we will try to replicate it at our end and will provide you more information accordingly.

We are sorry for the inconvenience caused.

Best Regards,

Hi Steve,


As additional information, on non Windows OSs you need to set font folder path according to your system. For example over Ubuntu 13.10 we installed Microsoft fonts and set font folder path as following. If you are using some non Window OS then please also set font folder path accordingly.

sudo apt-get install ttf-mscorefonts-installer

// Set font folder path
String path = “/usr/share/fonts/truetype/msttcorefonts/”;
// Adding a single font directory
// com.aspose.pdf.Document.addLocalFontPath(path);

// seting the user list for standard font directories
java.util.List list = com.aspose.pdf.Document.getLocalFontPaths();
list.add(path);


If issue persist then please share the above requested details to replicate issue at our end.


Best Regards,

Thanks for the suggestions. It does not look to be a language issue. We tested the below code on the same machine (Windows): stand-alone and bundled as an extension to Oracle’s Agile PLM application. Stand-alone it works fine. Bundled we get the null exception. I am guessing there is a conflict with something in your jar library and Oracle Agile’s classes.


FileInputStream fis = new FileInputStream(“C:\Users\Steve\Documents\PLMDoctor\Data\Drawings\Engineering-Drawing-2.pdf”);
FileOutputStream fos = new FileOutputStream(“C:\Users\Steve\Documents\PLMDoctor\Apps\WatermarkPDF\test2.pdf”);
try {
Document pdf = new Document(fis);

TextStamp textStamp = new TextStamp(“Sample Stamp”);

// position and orientation
textStamp.setVerticalAlignment(VerticalAlignment.Center);
textStamp.setHorizontalAlignment(HorizontalAlignment.Center);
textStamp.setTextAlignment(HorizontalAlignment.Center);

textStamp.setOpacity(.2f);
textStamp.setRotateAngle(30);

// font
TextState txtState = textStamp.getTextState();

txtState.setFont(FontRepository.findFont(“Arial”));
txtState.setFontSize(60.0F);
txtState.setForegroundColor(com.aspose.pdf.Color.getGreen());

// apply stamp
pdf.getPages().get_Item(1).addStamp(textStamp);

pdf.save(fos);
}
finally {
fis.close();
fos.close();
}

Hi Steve,


Thanks for your feedback. We have logged an investigation ticket PDFNEWJAVA-34933 to investigate Aspose.Pdf for Java issue with Oracle Agile Product Lifecycle Management Application. We will keep you update about the issue resolution progress.

We are sorry for the inconvenience caused.

Best Regards,

Hi Steve,


Thanks for your patience. We have made some fixes in Aspose.Pdf for Java regarding your issue. Can you please test the latest version of Aspose.Pdf for Java and share the results?

Bet Regards,

The issues you have found earlier (filed as PDFJAVA-34933) have been fixed in Aspose.Pdf for Java 17.5.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Great. Thank you. We ended up using another product in the meantime.

Hi Steve,


Thanks for writing back.

We really are sorry for the delay in providing fix against your issue. Please note that sometimes issues are just complex and related to many other internal components of the API. Which is why they do not get resolved unless internal components are fixed. The development team is busy fixing other already reported high priority issues, or fulfilling other high demanded enhancements/features in the API, so these reasons sometimes cause delay in the delivery of fix.

We really hope that you use our API in future and we will definitely try to accommodate you with best support, in case of any issue or assistance. We are sorry for the delay and inconvenience.


Best Regards,