0

Does IronPDF support html query parameters, or is there an alternate method?

I've been using IronPDF to convert an html file to PDF using the following method: var pdf = ironRenderer.RenderUrlAsPdf(reportPath);

However, the html located at reportPath now requires a parameter userid. I have tried var pdf = ironRenderer.RenderUrlAsPdf(reportPath?userid=1); but that gives me the following error: CheckHtmlFilePath - File not found: .../index.html%3Fuserid=1'

I can't see any documentation in IronPdf that parameters are supported. Does anyone have any work arounds?

1 Answers1

0

Instead of adding the parameter to the variable name, add it to the string. For example:

reportPath += "?userid=1";
var pdf = ironRenderer.RenderUrlAsPdf(reportPath);

Check the URL to see if there is already a parameter, and manipulate the URL string accordingly. If you posted more code I could have described more.

Alex T.
  • 73
  • 8