Wrong conversion (position of some text) docx2pdf

Hello,

I am using Aspose.Words for JAVA (developer lic). I have 1 file which incorrect convert to pdf.

wrong_convert.zip (94.2 KB)
The ja-nein-field switches to the wrong position.

Can you fix this problem?

@aleksand

Could you please share which version of Aspose.Words you are using along with code example to reproduce this issue at our end? We will investigate the issue and provide you more information on it. Thanks for your cooperation.

Firstly I use 19.3 but I test use last 19.5 and have the same result.

@aleksand

We have tested the scenario using the following code example and faced the exception.
“Cannot insert a node of this type at this location.”

We have logged this problem in our issue tracking system as WORDSNET-18630 . You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.

Document doc = new Document(MyDir + "G5070.docx"); 
doc.save(MyDir + "19.5.pdf");

Could you please share the code example that you are using at your end?

I am very sorry. My code is not so easy (it has some protection for exception for Aspose convert) and when I do your easy test I see that Aspose do not convert this document at all. It gave following error:

java.lang.IllegalArgumentException: Cannot insert a node of this type at this location.
at com.aspose.words.CompositeNode.zzZ(Unknown Source)
at com.aspose.words.CompositeNode.insertAfter(Unknown Source)
at com.aspose.words.zzZFA.zzB(Unknown Source)
at com.aspose.words.zzZFA.zzC(Unknown Source)
at com.aspose.words.zzZFA.zzYo(Unknown Source)
at com.aspose.words.zzZFA.zzZd5(Unknown Source)
at com.aspose.words.zzZEP.zzZc4(Unknown Source)
at com.aspose.words.zzZFA.copy(Unknown Source)
at com.aspose.words.zzZFA.zzZ(Unknown Source)
at com.aspose.words.zzZFA.zzZ(Unknown Source)
at com.aspose.words.zzX.zzZ(Unknown Source)
at com.aspose.words.FieldRef.zzZHS(Unknown Source)
at com.aspose.words.zz1D.zzr(Unknown Source)
at com.aspose.words.zz1D.zzt(Unknown Source)
at com.aspose.words.zz1D.zzM(Unknown Source)
at com.aspose.words.zz1D.zzP(Unknown Source)
at com.aspose.words.zz1D.zzS(Unknown Source)
at com.aspose.words.zz1D.zzW(Unknown Source)
at com.aspose.words.zz1D.zzYj(Unknown Source)
at com.aspose.words.zz1D.zzZ(Unknown Source)
at com.aspose.words.zz1D.zzZ3(Unknown Source)
at com.aspose.words.Document.zzZQ0(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)

p.s. Do I need close this item and open new?

@aleksand

Please create a standalone console application ( source code without compilation errors ) that helps us to reproduce your problem on our end and attach it here for testing.

Easy test that I use is following:

public static void main(String[] args) {
	setLic();
	String dataDir = "c:/Users/evgeny/Documents/05.2019/";
	// Load the document from disk.
	com.aspose.words.Document doc;
	try {
		doc = new com.aspose.words.Document(dataDir + "G5070.docx");
		com.aspose.words.PageInfo info = doc.getPageInfo(0);
		// Save the document in PDF format.
		dataDir = dataDir + "output.pdf";
		doc.save(dataDir);
	} catch (Exception e) {
		e.printStackTrace();
	}

}

Sorry forgot setLic function:

static void setLic(){
	try {
		String licStr = "***";
		com.aspose.words.License lic = new com.aspose.words.License();
		InputStream io =new ByteArrayInputStream(licStr.getBytes(Charset.forName("UTF-8")));
		 lic.setLicense(io);
		 io.close();
	} catch (Exception e) {
		e.printStackTrace();
	} 
}

@aleksand

We have tested the scenario using the shared code example and faced the same exception.

Exception in thread “main” java.lang.IllegalArgumentException: Cannot insert a node of this type at this location.
at com.aspose.words.CompositeNode.zzZ(Unknown Source)
at com.aspose.words.CompositeNode.insertAfter(Unknown Source)
at com.aspose.words.zzZFA.zzB(Unknown Source)

Yes I have the same result

Hi Tahir,

Can you said me when do you plan to fix this bug?

Thanks,
Evgeny.

@aleksand

Currently, this issue is under “In Review” phase. Hopefully, this issue will be fixed in near future. We will inform you via this forum thread once this issue is resolved.

@aleksand

The fix of this issue will be available in the next version of Aspose.Words i.e. 19.7. This release will be published at the start of next month (July 2019).

Thank you very much. I will wait next release :).

The issues you have found earlier (filed as WORDSNET-18630) have been fixed in this Aspose.Words for .NET 19.7 update and this Aspose.Words for Java 19.7 update.