iText 7 exception during convert html to pdf using itext : Default value of the css property "text-decoration-thickness" is unknown - itext7

Iam using Itext7 to convert html to pdf using HtmlConverter, and here is the html2pdf dependecy. Iam getting the following error in the log.
ERROR com.itextpdf.styledxmlparser.css.resolve.CssDefaults - Default value of the css property "text-decoration-thickness" is unknown.
<dependency>
<groupId>com.itextpdf</groupId>`enter code here`
<artifactId>html2pdf</artifactId>
<version>3.0.5</version>
</dependency>
sample html:
<head></head><body>
<p style="color: rgb(0, 0, 0); font-family: "Times New Roman"; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; text-align: left; break-inside: auto; break-after: auto; break-before: avoid; line-height: normal; margin: 14pt 0pt; text-indent: 36pt; border-left-style: hidden; border-right-style: hidden;">
<span lang="en-US" style="font-family: Calibri; font-size: 11pt; text-transform: none; font-weight: normal; font-style: normal; font-variant: normal; text-decoration: none;">
sample html with text-decoration-thickness warning in html2pdf conversion
</span>
</p>
</body>

you can try your test on the demo lab. if it does not work on the demo lab, it is not supported.

Related

Prevent outlook mobile from automatically creating links which arent real

So I am creating a new email template but somehow outlook mobile thought it was a good idea to turn all the text which looks like an href (but really isnt) into a link. This takes place in any HTML tag, "h1", "p", "span", "div" etc.
Is there any way to prevent this stupid feature from rendering on other peoples their phones?
Here is the code (all styles are inlined so there is no stylesheet):
<h1 style="font-family: Arial, Helvetica, sans-serif; font-weight: bold; Margin-bottom: 8px; Margin-left: 0; Margin-right: 0; Margin-top: 16px; color: #ffffff; padding: 0; font-size: 26px; line-height: 34px;">Order ID 204793</h1>
<p style="font-family: Arial, Helvetica, sans-serif; color: #ffffff; font-size: 20px; Margin-bottom: 24px; Margin-top: 0; line-height: 27px; mso-line-height-rule: exactly; margin-bottom: 16px;">08/09/2018, 15:47</p>
Wrap any text you don't want linked in a <a> tag of your own and style it so that it doesn't appear to be a link (e.g "color:#000000;text-decoration:none;"). You don't need to include an href attribute.

HTML Block and Inline Elements text selection in watir

how can I send a text in an HTML block and inline elements?
<gr_block p="0,7" style="display: inline;">My text</gr_block>
this also is connected to it
<span data-text="true">My text</span>
this is the messenger of facebook I'm trying to send a message via Watir. any ideas?
Messenger
update:
<div class="_5rp7 _5rp8" spellcheck="false">
<grammarly-ghost spellcheck="false">
<div data-id="d0205e5d-3e42-7f18-fa89-538e297341b2" data-gramm_id="d0205e5d-3e42-7f18-fa89-538e297341b2" data-gramm="gramm" data-gramm_editor="true" class="gr_ver_2" gramm="true" contenteditable="true" style="position: absolute; color: transparent; overflow: hidden; white-space: pre-wrap; border-radius: 0px; box-sizing: content-box; height: 19px; width: 307.951px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding: 0px; z-index: 0; border-width: 0px; border-style: none; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(0, 0, 0, 0); top: 0px; left: 0px;" width="307.951416015625">
<span style="display: inline-block; font: 400 14px/17.92px "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif; color: transparent; overflow: hidden; float: initial; clear: none; box-sizing: border-box; vertical-align: baseline; white-space: pre-wrap; width: 100%; margin: 0px; padding: 0px; border: 0px; letter-spacing: normal; text-shadow: none; height: 19px;">
<gr_block p="0,16" style="display: inline;">My text</gr_block>
</span><br></div>
</grammarly-ghost>
<div class="_5rpb"><div aria-autocomplete="list" aria-controls="js_8" aria-describedby="js_1" aria-expanded="false" aria-label="Type a message..." class="notranslate _5rpu" contenteditable="true" role="combobox" spellcheck="false" tabindex="0" style="outline: none; user-select: text; white-space: pre-wrap; word-wrap: break-word; z-index: auto; position: relative; line-height: 17.92px; font-size: 14px; transition: none; background: transparent !important;" data-gramm="true" data-txt_gramm_id="d0205e5d-3e42-7f18-fa89-538e297341b2" data-gramm_id="d0205e5d-3e42-7f18-fa89-538e297341b2" data-gramm_editor="true"><div data-contents="true"><div class="" data-block="true" data-editor="fenr1" data-offset-key="8b6hl-0-0"><div data-offset-key="8b6hl-0-0" class="_1mf _1mj"><span data-offset-key="8b6hl-0-0"><span data-text="true">My text</span></span></div></div></div></div><grammarly-btn><div class="_1BN1N Kzi1t BD-0J _7_mnr MoE_1 _2DJZN" style="z-index: 2; transform: translate(294.951px, 5px);"><div class="_1HjH7"><div title="Protected by Grammarly" class="_3qe6h"> </div></div></div>
</grammarly-btn></div>
</div>
Second element
<div aria-autocomplete="list" aria-controls="js_8" aria-describedby="js_1" aria-expanded="false" aria-label="Type a message..." class="notranslate _5rpu" contenteditable="true" role="combobox" spellcheck="false" tabindex="0" style="outline: none; user-select: text; white-space: pre-wrap; word-wrap: break-word; z-index: auto; position: relative; line-height: 17.92px; font-size: 14px; transition: none; background: transparent !important;" data-gramm="true" data-txt_gramm_id="d0205e5d-3e42-7f18-fa89-538e297341b2" data-gramm_id="d0205e5d-3e42-7f18-fa89-538e297341b2" data-gramm_editor="true">
My text
What you are asking is not possible by webdriver because webdriver doesn't change the content of the page, but it's possible by Java script.
Write the below code
element=b.element(xpath: "//span[text()='My text']")
b.execute_script("arguments[0].innerText='Your Text here'",element)
Your Text here will appear in the place of My text.

AMP: Custom font using font-face not working

I am trying to use a custom font using font-face in my AMP pages, but the font is not rendered. The console says "Font download timed out for icons".
#font-face {
font-family: 'icons';
src: url('/fonts/icos2/icomoon.ttf?126oo9') format('truetype');
font-weight: normal;
font-style: normal;
}
[class^="icon-"], [class*=" icon-"] {
font-family: 'icons';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-clock:before {
content: "\e94e";
}
<script async custom-element="amp-font" src="https://cdn.ampproject.org/v0/amp-font-0.1.js"></script>
<amp-font layout="nodisplay"
font-family="icons"
timeout="2000"
on-error-remove-class="icons-loading"
on-error-add-class="icons-missing"
on-load-remove-class="icons-loading"
on-load-add-class="icons-loaded">
</amp-font>
<span class="icon-clock"></span>
<span class="ribbon-txt">Text</span>
The font is being fetched via HTTPS.
Any help will be strongly appreciated.
Thanks!
Here is working Url
Js on Head
<script async custom-element="amp-font" src="https://cdn.ampproject.org/v0/amp-font-0.1.js"></script>
Css on Head
<style amp-custom>
h1 {
color: red;
}
#font-face {
font-family: 'icomoont';
src: url(https://www.fanaticguitars.com/download/icomoon.ttf) format('truetype');
}
.font {font-family: 'icomoont'; color:#f00;}
span {font-size:25px;}
[class^="icon-"], [class*=" icon-"] {
font-family: 'icomoont';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-clock:before {
content: "\e94e";
}
</style>
HTML
<span>Hello Font!</span>
<br>
<span class="font">Hello Font!</span>
<br>
<span class="icon-clock"></span>
<span class="ribbon-txt">Text</span>

iText is slow also by providing fonts

I provided css and fonts to iText as specified in https://developers.itextpdf.com/fr/node/2085: for this I installed arial.ttf on a directory. I provided also a css where I stated that Arial is the official font for all
h1 {
font-family: Arial;
font-size: 24px;
font-style: bold;
font-variant: normal;
font-weight: 500;
line-height: 26.4px;
}
h2 {
font-family: Arial;
font-size: 20px;
font-style: bold;
font-variant: normal;
font-weight: 500;
line-height: 22.4px;
}
h3 {
font-family: Arial;
font-size: 14px;
font-style: bold;
font-variant: normal;
font-weight: 500;
line-height: 15.4px;
}
body {
font-family: Arial;
font-size: 14px;
font-style: normal;
font-variant: normal;
font-weight: 400;
line-height: 20px;
}
p {
font-family: Arial;
font-size: 14px;
font-style: normal;
font-variant: normal;
font-weight: 400;
line-height: 20px;
}
but my server spent 2 minutes to create a pdf from a simple html page. Any other suggestion?

Cannot get rid of an underscore in a simple menu list item or center it either, I mean no matter what

I have tried everything, including "text-decoration: none;" and making sure all padding is removed. Should be a pretty basic and elemental procedure but nothing works.
Yes, I have read all I can find here and tried it or looked elsewhere on the net for a solution. Nothing is working.
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="site.css"/>
</head>
<style>
#main-nav {
font-family: Verdana, Geneva, sans-serif;
font-size: 13px;
width: 100%;
height: 30px;
margin: auto;
padding: 0;
text-decoration: none;
background-color: #D6D5D6;
list-style-type: none;
text-align: center;
}
.nav-list {
text-decoration: none;
text-align: center;
list-style: none;
font-family: Verdana, Geneva, sans-serif;
font-size: 13px;
width: 1000px;
margin-: auto;
padding: 0;
}
.nav-list > li {
margin: 0;
float: left;
width: 200px;
height: 30px;
position: relative;
line-height: 30px;
}
.nav-list > li > a {
width: 200px;
height: 30px;
text-align: center;
padding-top: 12px;
list-style-image: none;
}
.nav-list > li > a:hover {
background-color: #FFF;
}
#dropdown {
position: relative;
top: 30px;
width: 100px;
font-family: Verdana, Geneva, sans-serif;
font-size: 13px;
list-style-image: none;
list-style-type: none;
color: #F00;
}
.dropdown: li{
background-color:#697;
position:relaive;
width:200px;
height:30px;
text-decoration: none;
}
.dropdown: li a {
color: #ddd;
text-decoration:none;
position: absolute;
width:200px;
height:30px;
padding: 10px 0 0 10px;
box-sizing: border-box;
}
.dropdown: li a:hover {
background-color: #CCC;
}
body {
margin-left: 0px;
margin-top: 0px;
}
#transbar {
position: absolute;
z-index: -1;
width: 1000px;
left: 0px;
top: 0px;
}
#wrap {
width: 1000px;
top: 668px;
position: absolute;
margin-right: auto;
margin-left: auto;
}
#textbox {
font-family: Verdana, Geneva, sans-serif;
font-size: 13px;
font-style: normal;
height: 575px;
width: 1000px;
position: absolute;
z-index: -1;
margin-top: 80px;
margin-right: 50px;
margin-bottom: 50px;
margin-left: 50px;
}
</style>
<div id="wrapper">
<body>
<nav class="main-nav">
<ul class="nav-list">
<li>About
<ul style="list-style: none;" class="dropdown">
li>The Film</li>
<li>The Park</li>
</ul>
</li>
<li>Updates
<ul style="list-style: none;" "dropdown">
<li>Slideshow<li>
</ul>
</li>
<li>Trailers</li>
<li>Support</li>
<li>Contact</li>
</ul>
</div>
</body>
</html>
Add this to your CSS to remove underline effect for <li> links:
a:link {
text-decoration: none;
}
As for displaying <li> elements in the center of the page I've provided a simplified version of your code that centers each <li>.
HTML:
<ul>
<li>About</li>
<li>The Film</li>
<li>The Park</li>
<li>Updates</li>
<li>Slideshow</li>
<li>Trailers</li>
<li>Support</li>
<li>Contact</li>
</ul>
CSS:
a:link {
text-decoration: none;
}
ul {
text-align: center;
list-style-type: none;
}
ul li {
display: inline-block;
}
NOTE: you may want to adapt this to your current code, next time you ask a question like this probably best to post a link to a jsfiddle example of your code.
I got it to work. Fooling around with the width in the CSS "Box" attribute did the trick. I am using Dreamweaver as my text editor, btw. A width of 123px added to the ul CSS script did it for the first listed column. For the ul li column I had to mess with that as well. A measure of 68px on the width centered that. I don't know why this works, and as you tell I'm a novice at this.

Resources