Hi,
While creating a document, I am adding a hidden word (using builder.write()) , then I am inserting a html string (using builder.insertHtml()) and after that again i am adding an another hidden word with builder.write(). I want the html to start just after the hidden word (without any line break ) and the ending hidden character also have to bind with the html end (No need of any line space after the html content). This making lot of unwanted line break.
I am attaching My sample code input and output below. sample_doc.zip (596.4 KB)
It’s a very critical issue for me. So please help me to find out a solution ASAP.
I tried with your solution. I am also using ckeditor html content for download in default(If the user not import the word). That time this solution getting issue. I am attaching the issued output along with sample code to reproduce(ckeditor content hard coded inside the code.). and expected output.
Hi,
I am formatting a template document with some data.In the template for Heading_1 and normal style identifier, i defined all the styles need for resp. I am replacing a special word with content.I put the style identifier Heading_1 for the heading and normal for the content. But style defined in the style identifier is not applied in the heading and content in the downloaded document. Please help me to find this solution for this issue
We have logged the following issue in our issue tracking system:
WORDSNET-20644: Unable to set Heading 1 or Normal Styles to Content of a Document
We will further look into the details of this problem and will keep you updated on the status of the linked issue. We apologize for your inconvenience.
So, the reason is that you set both the Style and Paragraph properties, therefore some of the style properties are overridden. To avoid this, you should simply either use only style or only paragraph properties. We suggest to use only Style, remove all this ‘builder.getFont().setSize(tokenSize);’ and leave only ‘builder.getParagraphFormat().setStyleIdentifier(StyleIdentifier.HEADING_1);’. It should work as expected.
Also some code looks a bit strange, and you may want to remove it. For example:
Color tokenColor = builder.getParagraphFormat().getStyle().getFont().getColor();
skipped
builder.getParagraphFormat().getStyle().getFont().setColor(tokenColor);
We are planning to close linked issue (WORDSNET-20644) with “Not a Bug” status.
P.S. Please note that Formatting is applied on a few different levels. For example, let’s consider formatting of simple text. Text in documents is represented by Run element and a Run can only be a child of a Paragraph. You can apply formatting 1) to Run nodes by using Styles e.g. a Glyph Style, 2) to the parent of those Run nodes i.e. a Paragraph node (possibly via paragraph Styles) and 3) you can also apply ‘direct formatting’ to Run nodes by using Run attributes (Font). In this case the Run will inherit formatting of Paragraph Style, a Glyph Style and then direct formatting.
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.