We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Multiselect and radio is not working in PDF After conversion of html to pdf file

Arizona Texas Indiana Alaska

Please select your favorite Web language:

HTML
CSS
JavaScript

any update on it

@Thorat

Could you please share your input HTML, problematic PDF and expected output PDF files here for testing? We will investigate the issue and provide you more information on it.

i should be able select multiple option from dropdown and radio button name attribute getting override

image.png (152.6 KB)

@Thorat

Please share the requested resources here for our reference. We will then provide you information on it.

<!DOCTYPE html>
<html>
<body>
<form con>
  <label for="cars">Choose a car:</label>
  <select name="cars" id="cars" multiple>
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
    <option value="opel">Opel</option>
    <option value="audi">Audi</option>
  </select>
  <br><br>
  <input type="submit" value="Submit">
</form>
</body>
</html>

output.pdf (34.0 KB)

@Thorat

Are you using HtmlLoadOptions OR HtmlFragment to convert this HTML into PDF? Can you please share your code snippet with us so that we can replicate the issue with the same code and address it accordingly? We are sorry for the inconvenience.

HtmlLoadOptions

@Thorat

We have used this code snippet with 22.10 version of the API and did not notice any issue. The multiselect option was working correctly in the output PDF:

var LetterHeaderHtml = @"<!DOCTYPE html>
<html>
<body>
<form con>
  <label for=""cars"">Choose a car:</label>
  <select name=""cars"" id=""cars"" multiple>
    <option value=""volvo"">Volvo</option>
    <option value=""saab"">Saab</option>
    <option value=""opel"">Opel</option>
    <option value=""audi"">Audi</option>
  </select>
  <br><br>
  <input type=""submit"" value=""Submit"">
</form>
</body>
</html>";

//HTML TO PDF
var byteArray = Encoding.ASCII.GetBytes(LetterHeaderHtml);
var stream = new MemoryStream(byteArray);
var options = new HtmlLoadOptions();// { HtmlMediaType = HtmlMediaType.Print };
using var pdfDocument = new Document(stream, options);
stream.Close();

pdfDocument.Save(dataDir + @"html_test.PDF");

html_test.PDF (152.9 KB)

can you check that output generated file , are you able to select multiple option there
if yes let me know if not what would be solution on it because, i have checked this issue with that output file provided by you

@Thorat

No, we checked the output PDF and noticed that we were not able to select multiple options in the dropdown. Can you kindly share a PDF that has multiselect feature inside it and its working correctly? It would help us in rectifying the issue accordingly.

Test.pdf (4.2 KB)
Could You Please Check this pdf for your reference. in which pdf we are able select multiple options in dropdown and which is generated by other library

@Thorat

We were able to replicate the issue in our environment using 22.10 version of the API. Therefore, it has been logged as PDFJAVA-42264 in our issue tracking system for the sake of rectification. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

no problem

but this issue is based on java platform
let me correct if i wrong. you have logged this issue with PDFNET-53099
as .net. it should on java based .

@Thorat

An issue when it is logged for .NET, is resolved for Java API too. Nevertheless, we have updated the ticket ID and specified it for Java API now.

ok thanks. In which version it will resolved.

@Thorat

The issue has recently been logged in our issue tracking system and it will be investigation/fixed on a first come first serve basis and we will surely let you know via this forum thread as soon as we make some progress towards ticket resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.

any update on PDFJAVA-42264 ---- Status : Open

@Thorat

The ticket has recently been logged in our issue management system and it will be investigated/resolved on a first come first serve basis. We will surely inform you as soon as we have some updates regarding its fix. Please be patient and spare us some time.

We are sorry for the inconvenience.