Recently encountered a need to implement export PDF file, the Internet to check the following code summary of the code, you can successfully export PDF file.
You need to download a itextsharp.dll on the web before coding, this assembly is a must. Landlord download is 5.0 version, before the next 5.4 seems not good to use.
Add a reference directly after downloading.
<%@ Page language= "C #" autoeventwireup= "true" codebehind= "Webpdf.aspx.cs" inherits= "Web Export pdf.webpdf"%> DOCTYPE html>
Note the two image images in the code, and you can add the corresponding in your project. If all the above code has been written to find no error so congratulations you can successfully export.
If a class exception fails to find the class, then you need to refer to the file.
As for each person who needs to export a different style PDF content will be written according to the requirements of the corresponding code.
Export Success PDF exists in the project folder.
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.