dcsimg
Results 1 to 3 of 3

Thread: Create a PDF file and then save into a file server

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    445

    Create a PDF file and then save into a file server

    I need to create asp.net project to create PDF file in which some data coming from SQL server.

    This PDF file need to save into a file server.

    Where to start?

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    99,788

    Re: Create a PDF file and then save into a file server

    Quote Originally Posted by aspfun View Post
    Where to start?
    The same place you should always start: with a web search. In this case, words like "how to create a pdf file in asp.net" seem appropriate.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    CT
    Posts
    17,747

    Re: Create a PDF file and then save into a file server

    I use PDF Sharp in the back-end code to create PDF files from SQL data.

    http://www.pdfsharp.com/PDFsharp/

    What was coded like this to print to a printer in the past (in VB6)

    Code:
    objprt.Print strItem(prtItems(i, 7));
    Becomes this with PDF Sharp
    Code:
    ' Create an empty page
    Dim page As PdfPage = document.AddPage
    
    ' Get an XGraphics object for drawing
    Dim gfx As XGraphics = XGraphics.FromPdfPage(page)
    
    Dim font As XFont = New XFont("Verdana", 10, XFontStyle.Regular)
    .
    .
    .
    Dim dsSize As XSize = gfx.MeasureString(strItem(prtItems(i, 7)) + "'", font)
    gfx.DrawString(strItem(prtItems(i, 7)), font, objprtForeColor, New XRect(objprtCurrentX, objprtCurrentY, dsSize.Width - 1, dsSize.Height), XStringFormats.TopLeft)
    objprtCurrentX += dsSize.Width - 1

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width