Issue while inserting Rotated content in PDF


We are generating a PDF document by inserting an HTML Fragment in the PDF.

Our requirement is to rotate an image or text while inserting the same in PDF.

Below is the HTML Code that was used as an HTML fragment and was inserted in the PDF.

.rotate90 {
    -webkit-transform: rotate(90deg);
    -moz-transform: rotate(90deg);
    -o-transform: rotate(90deg);
    -ms-transform: rotate(90deg);
    transform: rotate(90deg);
    -webkit-transform: rotate(-90deg);
    -moz-transform: rotate(-90deg);
    filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); //For IE support
<div class="example-date">
  <span class="day">31</span>
  <span class="month">July</span>
  <span class="year">2010</span>
<img id="image_canv" src="webwb/AIGIndia.png" class="rotate90">

As you can see the generated PDF has all the content that was supposed to be included in it but without the intended rotation.
The same HTML code when rendered on the browser it provides the rotation to the content as the code shuld have.Attached is the screenshot of the browser page rendered through the same HTML code.

Please provide a resolution for the issue.

The version of Aspose PDF being used is
Testing (3) (2).pdf (2.5 KB)
Rotation Test.png (10.8 KB)


Thanks for contacting support.

We have tested the scenario in our environment by using both HtmlFragment and following approach, but did not get success to produce desired result.

HtmlLoadOptions loadoptions = new HtmlLoadOptions(dataDir);
loadoptions.PageInfo.Height = Aspose.Pdf.PageSize.PageLetter.Height;
loadoptions.PageInfo.Width = Aspose.Pdf.PageSize.PageLetter.Width;
loadoptions.PageInfo.Margin.Left = 70;
loadoptions.PageInfo.Margin.Top = 30;

string HTMLcontent = @"<html>
 .rotate90 {
       -webkit - transform: rotate(90deg);
       -moz - transform: rotate(90deg);
       -o - transform: rotate(90deg);
       -ms - transform: rotate(90deg);
       transform: rotate(90deg);
       display: block;
       -webkit - transform: rotate(-90deg);
       -moz - transform: rotate(-90deg);
       filter: progid: DXImageTransform.Microsoft.BasicImage(rotation = 3); //For IE support
<div class='example-date'>
<span class='day'>31</span>
<span class='month'>July</span>
<span class='year'>2010</span>
 <img id = 'image_canv' src='aspose.jpg' class='rotate90'>
MemoryStream ms = new MemoryStream();
TextWriter tw = new StreamWriter(ms);
ms.Seek(0, SeekOrigin.Begin);
Document doc = new Document(ms, loadoptions);
doc.Save(dataDir + "RotatedContent.pdf");

Therefore, we have logged an issue as PDFNET-43422 in our issue tracking system. We will further investigate the issue and will keep you posted with the status of its rectification. Please be patient and spare us little time.

We are sorry for the inconvenience.