Dear sir, madam,
I’m trying to put a nicely formatted text ("T: ", with space) into a custom document property. However, it appears that Aspose removes the trailing (and leading) whitespace from the property, because my output just gives me “T:” (without space). Have you got any idea how to avoid this?
It works if I put a character 8203 behind the spaces (a zero width space), but then Microsoft Word decides that that is a good spot to break and it isn’t a very clean solution.
Hi
Thanks for your request. I can’t reproduce the problem on my side. I use the following code for testing
doc.CustomDocumentProperties.Add(“T: test”, “T: test white spaces”);
Which version of Aspose.Words are you using? Could you also provide me more information about problem? Code example that will allow reproducing the issue could be useful.
Best regards.
What I do is something like this: doc.CustomDocumentProperties.Add("_Telephone", "T: ") (With a space behind the colon). The actual value becomes “T:” (so without the whitespace at the end). I use the newest version of Aspose.Words. The exact code is:
if (doc.getCustomDocumentProperties().contains(propName)) {
doc.getCustomDocumentProperties().get(propName).setValue(propValue);
}
and
if (doc.getVariables().containsKey(propName)) {
doc.getVariables().set(propName, propValue);
}
I’m very sure that the input to Aspose is correct, if I print the input right before I feed it to Aspose I can see the spaces. Could it have anything to do with the encoding of the String? Or is it just a problem in Aspose? Or, ofcourse, am I doing something stupid :)?
Hi
Thanks for your request. I managed to reproduce the problem and created new issue #6815 in our defect database. I will notify you as soon as it is fixed.
Best regards.
Is there any progress on this issue?
With version 3.0.1 we used a workaround by using zero width spaces, which worked fine at that time. Unfortunately in the newest release these characters get trimmed as well.
Is there another currently known solution for this problem?
Thanks for your inquiry. Unfortunately, I cannot suggest you any way to work around the problem at the moment. Why do you need white spaces at the end of Document Properties?
Best regards.
Hey Alexey,
On behalf of Ivo I would like to reply on your query. We need white spaces at the end of Document Properties because we use these properties in the layout of a word document. Enclosed is a document which clearly shows what we’re trying to do. In the document there are two fields which both contain DocProperties. The first is a label for a phonenumber (containing "T: ") and the second is the actual phonenumber (containing “0655124192”). As you can see, the label contains some trailing whitespace, to create some space between the label and the actual phonenumber.
Mind you, this document was created in word itself, so not with Aspose.
Thank you for addition information. Now, I understand why you need them. Maybe, as a workaround, you can just insert white spaces between fields.
Best regards.
Although this might be a solution for the moment, we cannot keep doing this. The problem is that our created word documents have to be interpreted again after creation by other tools than our own. These tools are not able to interpret the layout as such and can use only information in the actual properties, so putting whitespaces between the fields is not an option.
What is the problem with letting aspose just fill properties with what you actually put in them? The fact that aspose changes data that we put in fields sounds pretty disturbing to me, especially since Word is able to have properties with trailing whitespace. Could you inform me on why it is not possible? Because not having this functionality greatly reduces the useability of our software as we use aspose to create documents in a special layout which also have to be read back into document management systems.
Thank you for additional information. It seems this was done because earlier versions of MS Word trim white spaces from the beginning and end of document properties values. I will consult with our developers regarding this issue and provide you more information.
Best regards.
Thanks for your request. Yes, you are right. The issue is resolved in .NET version of Aspose.Words. The fix will be ported to Java version of Aspose.Words before the next java release, which will be published within a month.
Best regards,
Thanks for your request. Sorry, but 4.0 version does not include the fix of this issue. This version of Aspose.Words for Java includes only PDF conversion feature.
Best regards,
On November 12 2009 you mentioned this issue would be fixed in a java release scheduled for publication within a month. However, there is still no new release 8 months later. Could you provide us with a new estimate when we can expect this release?
Thanks for your request. We are still working on synchronizing of .NET and Java version of Aspose.Words and unfortunately the release date of Aspose.Words for Java has been moved to the second half of August 2010. You will be notified once it is released. Sorry for the inconvenience.
Best regards,
Could you confirm whether the issue is resolved in the 4.0.3 release of october last year? And if the issue isn’t resolved, could you give an estimate on when it will be fixed?
I must say, it’s been over two years since we first posted this issue, I find the lack of service a bit disturbing. You keep saying it will be fixed in a new release which is (to my knowledge) still not the case. Because of this we have stopped buying updates for your products, we may return when issues like this are fixed properly and when the “sync” between .NET and Java is a bit quicker.
Hi
Thanks for your request. Unfortunately, I cannot confirm that this issue is fixed in 4.0.3 version of Aspose.Words for Java. As we already mentioned the issue is already resolved in the .NET version. The fix will be available in the next version of Aspose.Words for Java.
We mostly finished synchronizing .NET and Java versions and we plan to release the new version of Aspose.Words for Java in March. This major release will contain a lot of new features, like converting to PDF, XPS and SWF, Field Updating, along with a lot of fixes, including a fix of the problem you mentioned in this thread.
You can check status of the work on synchronizing in our blog: https://blog.aspose.com/2011/02/11/autoporting-aspose-words-for-java-progress-11th-feb-2011
one more time, I apologize for inconvenience and that this take so long to fix the problem you reported.
Best regards,
We are happy to inform you that the first auto-ported version of Aspose.Words for Java is ready. This version supports converting documents to PDF. You can get it from here.
Best regards,
Aspose.Words team
(63)
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.