Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Levente Kosa 136 posts 352 karma points
    Nov 30, 2019 @ 17:01
    Levente Kosa
    0

    Page to PDF suggestion

    Hi,

    Does anybody can suggest me a good PDF converter. Free would be the best, but cheap option is an option.

    I have a page with a link and the link points to another page what I like to convert to PDF when I click on the link.

  • Graham Davis 110 posts 376 karma points
    Nov 30, 2019 @ 19:28
    Graham Davis
    0

    I have been using SautinSoft's PDF Vision for about 10 years and upgraded to the newest version this spring. I mainly use it to convert HTML Invoices into PDF.

    https://www.sautinsoft.com/products/pdf-vision/index.php

    My code looks like this:

       public string CreatePDF(string url, string fileName)
        {
            try
            {
                _pdf.Serial = _pdfSerial;
                fileName = _WorkingDirectory + fileName + ".pdf";
                if (File.Exists(fileName))
                {
                    File.Delete(fileName);
                }
                _pdf.PageStyle.PageMarginLeft.Inch(float.Parse("1.0"));
                _pdf.PageStyle.PageMarginRight.Inch(float.Parse("1.0"));
                _pdf.PageStyle.PageMarginTop.Inch(float.Parse("0.5"));
                _pdf.PageStyle.PageMarginBottom.Inch(float.Parse("0.5"));
                _pdf.ConvertHtmlFileToPDFFile(url, fileName);
                return fileName;
            }
            catch (Exception ex)
            {
                return string.Empty;
            }
        }
    
  • Levente Kosa 136 posts 352 karma points
    Nov 30, 2019 @ 20:33
    Levente Kosa
    0

    Thank you for the suggestion, although it seems the generated pdf is an image. In their demo I couldn't select any text. I will think about it.

  • Dan Soule 33 posts 194 karma points
    Nov 19, 2020 @ 20:50
    Dan Soule
    0

    Is this javascript code that can be embedded in the cshtml page?

  • Graham Davis 110 posts 376 karma points
    Nov 30, 2019 @ 20:49
    Graham Davis
    0

    No, it does create an actual pdf file.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies