Generate .pdf's?

  • Thread starter Thread starter Scott M.
  • Start date Start date
S

Scott M.

Can I have the output from an ASP.NET page be an Adobe .pdf file? I don't
mean that I want to output a .pdf file name. I mean I want to output a
document in .pdf format.

Thank you.
 
Scott M. said:
Can I have the output from an ASP.NET page be an Adobe .pdf file? I don't
mean that I want to output a .pdf file name. I mean I want to output a
document in .pdf format.

Thank you.


Yes
 
Scott M. said:
Can I have the output from an ASP.NET page be an Adobe .pdf file? I don't
mean that I want to output a .pdf file name. I mean I want to output a
document in .pdf format.

Set the 'Response' object's 'ContentType' property to "application/pdf" and
write the response...
 
Hi,

Here is a simple example that use the open source SharpPdf library.

http://sharppdf.it/home.asp

Private Sub btnPDF_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnPDF.Click
Response.Clear()

' set the content type to PDF

Response.ContentType = "application/pdf"

' write the buffer with pdf file to the output

Dim myDoc As New sharpPDF.pdfDocument("Image Application", "Me",
False)
' create the first page for the pdf

Dim myPage As sharpPDF.pdfPage
myPage =
myDoc.addPage(Enumerators.predefinedPageSize.csSharpPDFFormat)

myPage.drawCircle(300, 550, 100, pdfColor.DarkBlue, pdfColor.Blue)
' Finally write the pdf
myDoc.createPDF(Response.OutputStream)

Response.End()
End Sub

Ken
--------------------
Can I have the output from an ASP.NET page be an Adobe .pdf file? I don't
mean that I want to output a .pdf file name. I mean I want to output a
document in .pdf format.

Thank you.
 
Thanks Herfried, I guess I knew that but was wondering how I would then go
about writing in the Response in such a way as to be able to control the
formatting of the resulting .pdf.
 
Thanks Ken. I'll have to examine the SharpPdf library, but this sounds like
what I'm looking for.
 
It was due to your very detailed question that you had clearly already
researched....
 
Did it dawn on you that perhaps my post was my first attempt at researching
this topic? Did it dawn on you that this is a forum where people ask
questions about topics that they don't know about? Did it dawn on you that
perhaps I didn't ask a very detailed question because I still have too
little information about the topic to know what I should be asking? Did you
happen to notice that the other responses seemed to give me good information
to go on?

Do yourself and the rest of us a favor and keep your insightful
"information" and your cynical responses to yourself and go back to beating
your wife and kids instead of taking out whatever is eating you on us.
 
Both of you, grow up.

Yes, there are a number of products that you can use. There are some free
and commercial controls in various stages of support and development, you'll
find some in the control gallery at ASP.NET, and at Sourceforge.net. The
best way to find them on ASP.NET is to just drill into any category, and
search the entire library for PDF.

I've done a little work with the DynamicPDF components (dynamicpdf.com), so
check them out.

Your best bet is to narrow down exactlty what you want to do before you
start looking at the controls, and then find ones that fit your needs.
There is a wide variety of functionality available.
 
Scott M. said:
Did it dawn on you that perhaps my post was my first attempt at
researching this topic? Did it dawn on you that this is a forum where
people ask questions about topics that they don't know about? Did it dawn
on you that perhaps I didn't ask a very detailed question because I still
have too little information about the topic to know what I should be
asking? Did you happen to notice that the other responses seemed to give
me good information to go on?

This is something that could have easily been answered by doing a quick
google search. That would have taken 5 minutes of YOUR time though, and not
wasted 5 minutes of the time of each of the people that helped you, and 30
seconds from all of the other people that had to read your post.

It would just be nice if people would try to figure something out on their
own at least a LITTLE BIT, before they come running in here to ask their
question. The people here are, after all, volunteering their time to
answer your questions, the least you can do is try to save some of their
time and do some of the work yourself. If you get stuck, ask a question.

My answer certainly confirmed that you could do what you asked, and you
could have certainly taken the initiative to go out and learn on your own.
Developers should be able to learn on their own, without having things fed
to them. Otherwise, I would honestly rather have them doing something else
and leaving their job behind for someone who CAN do things on their own.

All I am asking for is that you TRY a little bit to answer your own question
before you come running in and wasting everyone's time.

Do yourself and the rest of us a favor and keep your insightful
"information" and your cynical responses to yourself and go back to
beating your wife and kids instead of taking out whatever is eating you on
us.

Were you just trying to think of the stupidest thing you could say, or what?
 
Blah, blah, blah...

For your information I AM one of those people who volunteer their time to
help others out in these newsgroups (and I have been for many years).

I have no idea what YOU think these forums are for, but I can tell you that
they ARE for doing exactly what you suggested I should go to Google for.

It's clear that you are bothered and annoyed by people who don't know what
you know, so the best solution is for YOU to not waste YOUR time by
responding.

Others were able to be helpful and point me in the right direction for
further investigation. It also seems that YOU have forgotten (or, perhaps
never knew in the first place) that these NG's are here to HELP people.
Nothing about anything you've said so far is helpful.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top