Hello, I’m trying to get a rectangle with rounded corners and shadow by converting HTML into PDF.
I’m using latest Aspose.HTML v25.05 for this.
A proper HTML does not work when processing through Aspose.Html and saving as PDF document.
Any hints on how to make it work?
Below the code I use and results I get.
var html = @"<style>
div {
margin: 20px;
width: 300px;
height: 200px;
background-color: #f1f1f1;
padding: 20px;
}
.parent {
/* display: flex;
justify-content: center;
align-items: center; */
background-color: transparent;
}
.back-div {
width: 300px;
height: 200px;
background-color: #ccc;
position: absolute;
z-index: 1;
padding: 0;
}
.top-div {
width: 280px;
height: 180px;
background-color: #ff0;
position: absolute;
z-index: 2;
padding: 10px;
}
.rounded {
border-radius: 20px;
}
.shadow {
background-color: transparent;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
</style>
<div class="rounded shadow">
Div with Rounded Corners and Shadow
</div>
<div class="rounded">
Div with Rounded Corners without shadow
</div>
<div class="shadow">
Div with Shadow
</div>
<div class="parent">
<div class="back-div shadow"></div>
<div class="top-div rounded">
Div-on-div - Top Div with Rounded Corners
</div>
</div>";
Aspose.Html.Converters.Converter.ConvertHTML(html, "../", new Aspose.Html.Saving.PdfSaveOptions(), "output.pdf");
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): HTMLNET-6394
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Hey, thanks for the answer.
We are assessing the Aspose.HTML at the moment, and if it does not fulfil our needs, we won’t buy it.
I created following workaround for this particular case, but was hoping for this feature to be supported with simplest approach possible - having border-radius and box-shadow on the same element.
Here is the workaround - layering 2 divs, smaller with box-shadow as background, larger with border-radius on top. It requires calculating/defining top and left to align the elements correctly.
Just in case anyone else needs it in future.
Thanks for sharing more information. We have updated the ticket information accordingly and have recorded your concerns as well. As soon as we make some progress towards ticket resolution, we will inform you. Please be patient and spare us some time.
Thanks for sharing this. We have again put it along with the previous details in the ticket and we will include this piece of information in our investigation as well.
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.