How to convert a xlsx file to a excel file without nugget and merge multiple pdf´s with chedlistbox [C# | WinForm]

Andi 111 Reputation points
2023-01-12T10:03:19.7766667+00:00

Hi,

in my current programm i am writing text into a xlsx file and save it. Now i would like to convert it to a PDF file, i found some nugget solutions but they are not optimal because i get a watermark in the endproduct and need to pay for that -.- .

Does someone have a solution for this?

Also i would like to merge multiple PDF´s which are selectable by checkedlistbox - didn´t found a good solution yet which is free of amount you want to merge. -.-

Thanks in advice.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,808 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,860 questions
{count} votes

Accepted answer
  1. Michael Taylor 53,971 Reputation points
    2023-01-12T16:21:17.68+00:00

    iTextSharp can manipulate and merge PDFs. It doesn't watermark but it does cost money if you're building a commercial product. The PDF format is not an open source format so companies that provide libraries for it generally have to pay the owner of the format (Adobe) and they tend to pass the cost on.

    To convert from XLSX to PDF have you considered just printing the file to PDF? I haven't checked a clean Windows install in a while but every version of Windows I have provides a printer to print to PDF. So the easiest, non-third party solution, would be to print to PDF. Of course printer settings and whatnot could add their own challenges to the mix but I suspect you'll have to handle that anyway.

    Another thing to consider is whether XLSX to PDF is actually the best choice. Do you have to use XSLX or can you just generate the PDF directly from the data that is being used to build the XSLX? Is this a report and, if so, does the data come from a database like SQL Server or something? If so then perhaps you should look into a reporting library instead that allows you to generate a PDF directly. This would give you more flexibility in the PDF look and feel in my opinion.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Jack J Jun 24,491 Reputation points Microsoft Vendor
    2023-01-16T07:19:31.13+00:00

    @Andi, Welcome to Microsoft Q&A, based on my search, Microsoft does not provide the related library about how to convert excel to pdf and merge many pdf files into one pdf file.

    I recommend that you could request a feature about .NET in DC.

    Best Regards,

    Jack


    If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our [documentation][3] to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.