![]() |
#2
|
|||
|
|||
![]() Code:
Sub pdf() Const sFile As String = "C:\test\1.pdf" Dim f As Integer Dim byt As Byte Dim str As String, str1 As String f = FreeFile Open sFile For Binary Access Read As #f Do While Loc(f) < LOF(f) Get f, , byt str1 = str1 & byt & vbNewLine Loop Close m ''' str1 ''' different from the output when I use C# StreamReader to extract the data from the pdf file End Sub First, I bet there is something to do with Binary. The error "Input past end of file" seems to be caused by reading binary files and I think using Loc() could have helped solve it. Second, I declare a variable for the binary data. I think it works with the binary data extracted from the pdf file. But third, the output (string str1) is still different from what I get from a C# code (which works well to count the pages of a pdf file). Anyway, I think I still need to be working hard on it since even I get the page count from the C# code. It cannot be used in Excel. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
zatlas1 | Office | 8 | 04-28-2012 02:37 PM |
![]() |
gleckie | Word | 2 | 02-02-2012 07:51 AM |
![]() |
Pianoman 74 | Word | 3 | 01-26-2012 03:56 PM |
File Conversion Error | azii | Word | 0 | 01-04-2012 04:34 AM |
Runtime error 5487 - Word cannot complete the save to to file permission error | franferns | Word | 0 | 11-25-2009 05:35 AM |