Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Nov 20, 2023 10:20 am

Hi, I need to convert html to pdf with editable fields.
Is there a way?
Thanks

MbbOpenSolutions
 
Posts: 2
Joined: Thu Aug 12, 2021 9:09 am

Tue Nov 21, 2023 7:32 am

Hi,

Thank you for your inquiry.
What is your meaning of “convert HTML to PDF with editable fields”? It refer to the input html file that includes widget such as textbox, buttons, and then converted to a Pdf file that also includes the same textbox, buttons that can be edited? I suggest you can first do test by referring to our official website C #/VB NET: Convert HTML to PDF or Java: Convert HTML to PDF according to your own needs. If your need can't be meet according to the help document, please offer the following information to help us do further investigation. Thank you in advance.
1) Your input html file, you can attach here or send it to us via email (support@e-iceblue.com).
2) Your full test code that can reproduce your issue.
3) Application type, such as Console App, .NET Framework 4.8 or Jdk 1.8.
4) Your test environment, such as OS info (E.g. Windows 7, 64-bit).

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Tue Nov 28, 2023 11:31 am

Hi, thank you for your replay. I tried to use the plugin but the pdf is not editable.

Here my test console (in .net framework 4.8 x64):

using Spire.Pdf.HtmlConverter.Qt;
using System;
using System.IO;
using System.Reflection;

namespace ConvertHtmlToPdf
{
internal class Program
{
private static string AssemblyDirectory
{
get
{
var codeBase = Assembly.GetExecutingAssembly().CodeBase;
var uri = new UriBuilder(codeBase);
var path = Uri.UnescapeDataString(uri.Path);
return Path.GetDirectoryName(path);
}
}

private static void Main()
{
//Get the HTML string from a .html file
var htmlPath = Path.Combine(AssemblyDirectory, "Input.html");

//Specify the output file path
var fileName = Path.Combine(AssemblyDirectory, "Output.pdf");

//Specify the plugin path
var pluginPath = Path.Combine(AssemblyDirectory, "plugins-windows-x64\\plugins");

//Set plugin path
HtmlConverter.PluginPath = pluginPath;

//Convert HTML string to PDF
var stream = new MemoryStream();
HtmlConverter.Convert(htmlPath, stream);
var file = stream.ToArray();
File.WriteAllBytes(fileName, file);
}
}
}


And here my html file (Input.html):
<html>
<body>
<label>Test Input</label>
<input type="text" name="test"/>
</body>
</html>

The console produce a file (Output.pdf) but the input is not editable.

Thanks

MbbOpenSolutions
 
Posts: 2
Joined: Thu Aug 12, 2021 9:09 am

Wed Nov 29, 2023 6:18 am

Hi,

Thank you for your feedback.
Sorry, our product currently doesn’t support converting html to pdf with editable fields. The pdf file converted through our product can only present the same style effect as html file, but there is no actual editing function. I have recorded this new function in our error tracking system, numbered “SPIREPDF-6421” . Our development team will make every effort to research and achieve it in the future. If this function is completed, we will notify you as soon as possible. We deeply apologize for any inconvenience caused to you.

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Return to Spire.PDF

cron