🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.reader
Article #15321

Re: Printing problems with Acrobat Reader (Activex control) and javascript

#15321
From: FISHop
Date: Tue, 18 Jul 2006 18:28
30 lines
1705 bytes
Hi,

I have the same problem with printing so can't help there but I do have a solution for Federico's streaming. The following snippet of code streams a pdf file. It is written in the C# codebehind for a page named PDFStreamer.aspx. I set the "src" attribute of my iframe to PDFStreamer.aspx, which automatically loads the code and streams the file on load. It works for both Adobe v6.x and 7.x.

	private void Page_Load(object sender, System.EventArgs e)
	{
				// Stream it!
	 this.SendStream( <INSERT YOUR FILE PATH HERE> );

	}

	private void SendStream( String strFileLoc)
	{

	// Put user code to initialize the page here
	Response.ContentType = "application/pdf";
	Response.AddHeader("Content-Disposition", "inline;");			
	FileStream tr =
	 new FileStream ( strFileLoc, FileMode.Open);
	long filesize = tr.Length;
	byte [] buffer = new byte[filesize] ;
	tr.Read(buffer, 0, (int)filesize);
	tr.Close();

	Response.OutputStream.Write(buffer, 0, (int)filesize);
	Response.Flush();
	Response.Close();
}

FISHop
Technical Details
Message-ID: <3bbfa93c.1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!newsfeed.freenet.de!news.albasani.net!news.ecp.fr!news.stben.net!webcrossing
References: <3bbfa93c.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10273d,b5b540182160c990,start
X-Google-Attributes: gid10273d,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: FISHop@adobeforums.com
Newsgroups: adobe.reader
Subject: Re: Printing problems with Acrobat Reader
 (Activex control) and javascript
Message-ID: <3bbfa93c.1@webcrossing.la2eafNXanI>
Date: Tue, 18 Jul 2006 11:28:11 -0700
References: <3bbfa93c.-1@webcrossing.la2eafNXanI>
Lines: 35
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!newsfeed.freenet.de!news.albasani.net!news.ecp.fr!news.stben.net!webcrossing