Hi,
I use Converter.ConvertHtmlStringToWeb() to display the converted PDF in the browser, but when the user clicks the Save button in Adobe, the filename for the PDF seems to always be whatever the aspx page was (i.e. DetailsPage.pdf). Is there a way to override this?
I have tried the downloadAsFileName overload and it does not seems to work, and I do not see anything in the HtmlConversionOptions object.
Thanks.
ConvertHtmlStringToWeb PDF File Name
Re: ConvertHtmlStringToWeb PDF File Name
Support · Dec 8, 2010Hello,
Can you please try the below sample code and see if it works for you?
string htmlString ="<html><head><title>ceTe software</title></head><body>DynamicPDF Converter</body></html>";
HtmlConversionOptions options=new HtmlConversionOptions(false);
Converter.ConvertHtmlStringToWeb(htmlString, options, false, "ceTe.pdf", true, null);
The ConversionOptions object can be only used for specifying any options available for that specific conversion. Options such as the output page orientation, page size, margins, unit type and whether to append to a current document can all be handled through ConversionOptions.
Thanks,
ceTe Software Support Team.
Re: ConvertHtmlStringToWeb PDF File Name
Forum member · Dec 8, 2010Hi,
The filename works when forceDownload is set to true, but in this particular case, I need the PDF to open within the browser, so I set forceDownload to false.
When clicking the Save button within the Adobe browser plug-in, the filename does not get applied and it just uses the name of the aspx page (i.e. if www.site.com/Details.aspx, then the filename automatically becomes Details.pdf).
Is there a way for the filename to be set in this particular case as well? Thanks.
Re: ConvertHtmlStringToWeb PDF File Name
Support · Dec 8, 2010Hello,
Its not possible to force the file name using the Converter API when the Save button on the Adobe browser plug-in is clicked. It is the functionality of the Adobe plug-in and we don't have control over it.
Thanks,
ceTe Software Support Team.