Apose Web Page в Pdf не работает должным образом

Привет Моя веб-страница имеет чистый HTML с некоторыми ссылками на файлы CSS и JS

<link href="../../bootstrap/less/bootstrap.less" type="text/css" rel="Stylesheet" /><link href="../../bootstrap/less/print.less" type="text/css" rel="Stylesheet" media="print" />
<script src="/js/jquery-1.7.2.js" type="text/javascript"></script>
<script src="/js/jquery-ui.js" type="text/javascript"></script>
<script src="/js/plugins.js" type="text/javascript"></script>
<script src="/js/bootstrap-modal.js" type="text/javascript"></script>

Но в настоящее время, когда я использую подход WebPage к Pdf

Это не сидит прямо в PDF

Вот мой код

public static void DownloadPdf(string encId, string code)
    {

        var hostlink = ""; //proper link is sett here

        WebRequest request = WebRequest.Create(hostLink);
        request.Credentials = CredentialCache.DefaultCredentials;
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();

        Stream dataStream = response.GetResponseStream();
        StreamReader reader = new StreamReader(dataStream);

        string responseFromServer = reader.ReadToEnd();
        reader.Close();
        dataStream.Close();
        response.Close();

        MemoryStream stream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(responseFromServer));
        HtmlLoadOptions options = new HtmlLoadOptions(HttpContext.Current.Server.MapPath("~"));

        Document pdfDocument = new Document(stream, options);
        options.PageInfo.IsLandscape = true;
        pdfDocument.Save(HttpContext.Current.Server.MapPath(downloadPath + code + ".pdf"));
    }

Моя веб-страница

но мой PDF выглядит так

0 ответов

Другие вопросы по тегам