I’m evaluating this product and I’m having problems with date formats.
Actually, what I need to do is receive a .docx file and export to .pdf. This process goes fine but for document headers I have a timestamp and using Aspose.words for java I get this format: Version 9/13/2018 3:08:00 PM
However, in my previous implementation (without Aspose.words) I had this: Version 13.09.2018 09:22:00.
I have tried 2 different ways to try to get the desired format, the first was change system’s locale, produce pdf file, restore original locale. The second was to get all Run nodes in the document and change the locale. Both did change nothing.
My sample codes are:
Document doc = new Document(document.getInputStream());
NodeCollection<Run> collection = doc.getChildNodes(NodeType.RUN, true);
for (Run run : collection) {
run.getFont().setLocaleId(1031); // From MS - German Germany de-de 1031
}
doc.save(response.getOutputStream(), SaveFormat.PDF);
And:
Locale current = Locale.getDefault();
Locale.setDefault(new Locale("de", "DE"));
Document doc = new Document(document.getInputStream());
doc.save(response.getOutputStream(), SaveFormat.PDF);
Locale.setDefault(current);
Is there something I’m missing?