Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6475213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:40:40+00:00 2026-05-25T06:40:40+00:00

I m creating a pdf file on the server using iTextSharp. It is working

  • 0

I m creating a pdf file on the server using iTextSharp.
It is working fine prompting me to save everything is fine.
I have 2 scenario
1) I want to save this file on a location on server
2) I want to save this file in database

My Last line after finishing the code is

document.Close();

So can anyone guide me how can I do it

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:40:41+00:00Added an answer on May 25, 2026 at 6:40 am

    The following method will create a new file on the disk with a paragraph in it. You could easily modify it to your needs.

    Before this will work you must ensue the directory you wish to save to has the correct permissions set. Whatever user account the Application Pool for the website is using will need write access to the folder. Set this in Windows Explorer, Right Click > Properties > Security Tab. This is well documented on the internet.

    You can store the filename in the database in many different ways and then link to the file from your UI. I suggest starting with a simple ADO.Net tutorial

    protected void CreateDoc(string filename)
    {
        Document document = new Document();
        PdfWriter.GetInstance(document, new FileStream(filename, FileMode.Create));
    
        document.Open();
        document.Add(new Paragraph("Hello World!")); 
        document.Close();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a PDF file on the fly using ITextSharp and ASP.NET 1.1. My
I'm currently converting some legacy code to create PDF files using iTextSharp. We're creating
I'm creating a pdf file using BIRT reporting library. Later I need to digitally
Hi I have created a PDF file with an image in it, I want
I have the following acceptance criteria for creating a pdf file from my asp.net
I have a set of 1000 pdf in my server. Now, i want to
I want to convert local html file on iPhone to PDF document. I have
I am creating a pdf document using C# code in my process. I need
I'd like to attach a PDF file stored as binary object in SQL Server
I'm using Reportlab to create PDFs. I'm creating two PDFs which I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.