We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Pre-sales technical questions

I am considering your Words/Java product for a project. Wanted to see if I could get some questions answered up front.


  • Can I do a global search and replace operation on an existing MS Word document where the search is based on a regular expression?
  • Will such a search work across style boundaries, e.g., if I want to search on “some_string” and in the document the letters “some” are in bold but “_string” is not bolded?
  • Assuming regular expression searches are allowed, can such a search span multiple paragraphs and/or tables? For example, in a MS Word document, if I have a hard coded string “<<>>”, followed by several paragraphs of text and a table or two, followed by “<<>>”, can I search and replace that in a straightforward way?
  • Within an existing table, can I append a row that is an exact copy of the current last row?
  • Can I append an entire MS Word doc to an existing MS Word doc? And if so, can the content of the 2nd doc start on the last page of the 1st doc (that is, no page break between 1st and 2nd doc)?
thanks,
Eric.

Hello Eric,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your interest in Aspose.Words for Java.

1. Yes, you can do it. Please see the following link to learn more:

http://www.aspose.com/documentation/java-components/aspose.words-for-java/find-and-replace-overview.html

2. Yes this search works across style boundaries.

3. I think you can use ReplaceEvaluator in this case.

4. Yes you can do it using Aspose.Words.

5. Please see the following link to learn how to concatenate documents using AppendDocument method:

http://www.aspose.com/documentation/java-components/aspose.words-for-java/howto-join-and-append-documents.html

Best regards,

Hi Eric,

Thanks for considering Aspose. Feel free to ask questions at any time.

  • Yes Aspose.Words can do searches and regular expression searches on text in a document. Please see the documentation here for some examples.
  • Differences in formatting can be ignored i.e using the range method
  • Yes this is possible.
  • This can be achieved easily using the Document Builder, please check the documentation here for details.
  • Yes, please see the documentation regarding Appending documents here for details.

If you have any further queries please feel free to ask.

Thanks,

Thank you for your answers.


Another question: is it possible to insert images (.png, jpg, etc.) into a Word document?

Yes, of course, please see the following link for detail:

http://www.aspose.com/documentation/java-components/aspose.words-for-java/com/aspose/words/documentbuilder.html#insertImage(byte[])

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Best regards,

Can anyone point to an example that can perform the task in the 3rd bullet from my original question? Or maybe just write out a little pseudo-code? I naively tried this (very dumb test) on attached testIn.doc, but got UnsupportedOperationException:


public class AsposeWordsTest {
static int mMatchNumber = 0;
public static void main (String[] args) {
try {
Document doc = new Document(“testIn.doc”);
mMatchNumber = 0;
doc.getRange().replace(
Pattern.compile("(?s)<<>>.*<<</MARKER>>>"),
new ReplaceEvaluator () {
public int replace(Object object, ReplaceEvaluatorArgs e) throws Exception
{
e.setReplacement(e.getMatch().toString() + mMatchNumber);
mMatchNumber++;
System.err.println(“mMatchNumber=”+mMatchNumber);
return ReplaceAction.REPLACE;
}
},
true);
doc.save(“testOut.doc”);
} catch (Exception e) {
e.printStackTrace();
}
}

}

I have another question. According to this link digital signatures are not supported for a (complete) MS Word document. Is that feature on your technical roadmap? If so, when do you expect it to be released?

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request.

1. There is no simple way to remove/replace content between placeholders. However, you can try using the technique suggested in the following forum thread:

http://www.aspose.com/community/forums/242811/range.replace-regex/showthread.aspx#242811

Code is in VB, please let me know if you have problems with translation to Java.

2. You are right, currently Aspose.Words does not support Digital Signatures. Your request has been linked to the appropriate issue. You will be notified as soon as this feature is available.

Best regards.

Thank you Alexey. Is there any time estimate for when the digital signatures feature becomes available?

Hi Eric,

Thanks for your inquiry. The verification of a digital signature on a DOC/DOCX document is planned to be supported sometime around August. The functionality of digitally signing a document however has not been planned yet. It will be avaliable sometime in the future, we will inform you about any developments.

Thanks,

The issues you have found earlier (filed as 10711) have been fixed in this update.

Alexey, thanks for the update but I’m a bit confused … my original inquiry is specifically for Aspose/Words for Java, but the link you provided is for the .NET. Did you perhaps put the wrong link?

Hi Eric,

Thanks for your inquiry.

You're right, the verification of digital signatures has been released for the .NET version but not for Java yet. As you may know we are working on a porting system which will automatically port all .NET code to Java. This means nearly all functionality that is avaliable in the .NET platform will be avaliable in Java.

This functionality will be released for Java in due time although not with the first release of the newest Java version. This is because currently the code behind digital signatures uses .NET cryptography and more time is needed to make it platform independent. We will keep you informed when this feature is avaliable for Java.

Thanks,

The issues you have found earlier (filed as WORDSJAVA-37) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(1)

The issues you have found earlier (filed as WORDSNET-2852;WORDSNET-656) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(26)