Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: Open linked PDF-Files from a PDF-File

Reply
Thread Tools

Re: Open linked PDF-Files from a PDF-File

 
 
Carl Prothman [MVP]
Guest
Posts: n/a
 
      08-09-2003
Paul,
Open up the PDF file using a FileStream, then read it in using a BinaryReader,
then replace the URL links in the file, then write the file out to the Response.
So something along the lines of:

' Open up the PDF file
Dim fileName As String = New String("d:\\work\\test.pdf")
Dim fileStream As System.IO.FileStream = New System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read)
Dim fileLength As Long = fileStream.Length

' Read the file in
Dim binaryReader As System.IO.BinaryReader = New System.IO.BinaryReader(fileStream)
Dim fileByteArray As Byte() = binaryReader.ReadBytes(CType(fileLength, Integer))
fileStream.Close()

' Replace URL
' ToDo... Use fileByteArray.BinarySearch()

' Write out the PDF file
Response.Clear()
Response.Buffer = False
Response.CacheControl = "public"
Response.ContentType = "application/pdf"
Response.AddHeader("Content-Length", fileLength.ToString())
Response.AddHeader("Content-Disposition", "in-line; filename=" & "test.pdf")
Response.BinaryWrite(fileByteArray)
Response.End()

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com


"Paul Kuebler" <(E-Mail Removed)> wrote
> Hello
>
> I send a PDF-File with
> string FilePath="PDFFiles\\Test1.pdf";
> Response.ContentType="Application/pdf";
> Response.WriteFile(FilePath);
> Response.Flush();
> Response.End();
> to the client browser. In this PDF-File
> are links to other PDF-Files. This PDF-files
> are on the server in the same directory as Test1.pdf.
> Is there a solution to open the selected
> PDF-File. The link path in Test1.pdf to the
> other PDF-files is only their filename.
>
> Thanks
> Paul



 
Reply With Quote
 
 
 
 
Carl Prothman [MVP]
Guest
Posts: n/a
 
      08-11-2003
"Paul Kuebler" <(E-Mail Removed)> wrote
?????????????????????????????????????????????????? ??????????????????????????????????????????????????
?????????????????????????????????????????????????? ??????????????????????????????????????????????????
?????????????????????????????????????????????????? ??????????????????????????????????????????????????
?????????????????????????????????????????????????? .?????????????????????????????????????????????????
?????????????????????????????????????????????????? ??????????????????????????????????????????????????
?????????????????????????????????????????????????? ??????????????????????????????????????????????????
?????????????????????????????????????????????????? ??????????????????????????????????????????????????
?????????????????????????????????????????????????? ??????????????????????????????????????????????????
?????????????????????????????????????????????????? ??????????????????????????????????????????????????
?????????????????????????????????????????????????? ??????????????????????????????????????????????????
?????????????????????????????????????????????????? ??????????????????????????????????????..?????????? ?
?????????????????????????????????????????????????? ??????????????????????????????????.???????????????
?????????????????????????????????????????????????? ??????????????????????????????????????????????????
?????????????????????????????????????????????????? ??????????????????????????????????????????????????
?????????????????????????????????????????????????? ??????????????????????

Paul,
If you have a question, then ask it. Otherwise please don't be rude...

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP
http://www.able-consulting.com




 
Reply With Quote
 
 
 
 
Paul Kuebler
Guest
Posts: n/a
 
      08-12-2003
?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ????????????????..???????????????????????????????? ?????????????????????????????????????????????????? ?????????????.???????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?
 
Reply With Quote
 
Paul Kuebler
Guest
Posts: n/a
 
      08-12-2003
?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ????????>
 
Reply With Quote
 
Paul Kuebler
Guest
Posts: n/a
 
      08-12-2003
?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ????????????????????????????..???????????????????? ?????????????????????????????????????????????????? ?????????????????????????.???????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????????????????????????????????????????? ?????????????
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is fast dynamically linked executable or statically linked executable ?how to decide? pratap C Programming 20 03-07-2007 04:46 AM
Linked list within a linked list joshd C++ 12 10-02-2006 08:57 AM
Linked list, New try (was:Linked list, no out put,help) fool C Programming 14 07-03-2006 12:29 AM
Generating a char* from a linked list of linked lists Chris Ritchey C++ 7 07-10-2003 10:12 PM
Generating a char* from a linked list of linked lists Chris Ritchey C Programming 7 07-10-2003 10:12 PM



Advertisments