I want to generate a pdf file of "the current page".
It is a ASP.NET aspx file created partly from GET parameters, but most often
using the ASP.NET event model (i.e. clicking buttons etc).
One of the buttons is called "Generate a pdf document of the current page"
and it clicking it should create a pdf document on the server side and
returning the pdf to the user.
To my aid I have a server side component that can convert a file or the html
content of a URL to a pdf document. So if I somehow can generate the
information of the current aspx page to file, I can convert it to pdf and
change the Response.ContentType to "application/pdf".
But the question is how to generate the file that I want to convert. If I
send the current URL to the pdf component, it will point to the page and how
it looks when no interaction has been done. What I really want is the page
after all clicks, i.e. how it looks "right now".
Any ideas? Thank you,
--
/Fredrik 3 1208
Thus wrote Fredrik, I want to generate a pdf file of "the current page".
It is a ASP.NET aspx file created partly from GET parameters, but most often using the ASP.NET event model (i.e. clicking buttons etc).
One of the buttons is called "Generate a pdf document of the current page" and it clicking it should create a pdf document on the server side and returning the pdf to the user.
To my aid I have a server side component that can convert a file or the html content of a URL to a pdf document. So if I somehow can generate the information of the current aspx page to file, I can convert it to pdf and change the Response.ContentType to "application/pdf".
But the question is how to generate the file that I want to convert. If I send the current URL to the pdf component, it will point to the page and how it looks when no interaction has been done. What I really want is the page after all clicks, i.e. how it looks "right now".
Any ideas? Thank you,
HttpResponse allows you set another stream as a filter using HttpResponse.Filter.
You could use that to write the response to a temporary file, create the
PDF, and write the PDF back to the actual response stream.
Cheers,
--
Joerg Jooss ne********@joergjooss.de
Very interesting!
It seems the file isn't created until the Response ends. This seems natural
to me when thinking about it.
But when the response has ended, I per definition have lost my chance to
alter the response (remeber, I wamt to send the pdf instead). I guess I will
have to trigger another request somehow, and in the new Response show the pdf.
Havn't still figured out the last details yet. Thanks, anyhow, for your kind
help.
Regards
--
/Fredrik
"Joerg Jooss" wrote: Thus wrote Fredrik,
I want to generate a pdf file of "the current page".
It is a ASP.NET aspx file created partly from GET parameters, but most often using the ASP.NET event model (i.e. clicking buttons etc).
One of the buttons is called "Generate a pdf document of the current page" and it clicking it should create a pdf document on the server side and returning the pdf to the user.
To my aid I have a server side component that can convert a file or the html content of a URL to a pdf document. So if I somehow can generate the information of the current aspx page to file, I can convert it to pdf and change the Response.ContentType to "application/pdf".
But the question is how to generate the file that I want to convert. If I send the current URL to the pdf component, it will point to the page and how it looks when no interaction has been done. What I really want is the page after all clicks, i.e. how it looks "right now".
Any ideas? Thank you,
HttpResponse allows you set another stream as a filter using HttpResponse.Filter. You could use that to write the response to a temporary file, create the PDF, and write the PDF back to the actual response stream.
Cheers, -- Joerg Jooss ne********@joergjooss.de
Thus wrote Fredrik, Very interesting!
It seems the file isn't created until the Response ends. This seems natural to me when thinking about it.
Are you sure you just don't need a Response.Flush()?
Cheers,
--
Joerg Jooss ne********@joergjooss.de This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: superseed |
last post by:
Hi,
I'm currently coding in C# a class to control a PTZ (Pan Tilt Zoom)
Camera. To control the camera I have to send request on a CGI on it.
Something like this :
...
|
by: Richard |
last post by:
Hello,
I'm dynamically writing out a web page using response.write. The page has
images and hyperlinks (each hyperlink points back to the same page, but with
a different parameter which...
|
by: JIM.H. |
last post by:
Hello,
In my login screen I validate user against SQL table and call my main page
with Reponse.Redirect("myPage.aspx"); I see my application comes there but
does not switch to myPage.aspx, I used...
|
by: Nuno Magalhaes |
last post by:
I'm doing a "low level" project that consists on monitoring certain QoS
parameters such as: Time to resolve dns, time to connect, time to
receive data, time to receive all web page, time to close...
|
by: Samuel Shulman |
last post by:
Hi
I am looking for a way to send a POST request using the
Reponse.Redirect or any thing similar
Thank you,
Samuel
|
by: anukedari |
last post by:
Hi,
Could any boby please help to get the answers for the following questions:
Is Apache always sends "X-Cache:MISS" header even when caching is off (disable)? or
Can we say that cache...
|
by: djtodd |
last post by:
Is there any way to use reponse.redirect and provide network credentials for basic auth along with it to prevent the nt security dialog box when hitting the new server location? or, is there another...
|
by: ross-mcm |
last post by:
I have an app that gets a file from a web server. An ASP page is
passed
authenitication data (username, password) and a filename. The file is
read
and then output by the ASP page so the only...
|
by: jmk |
last post by:
I'm trying to use an external SMS-service through .NET Framework 1.1
and using the webClient.DownloadData(strMessage) method. The
strMessage is a string consisting the parameters to send a message,...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |