Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Kako otvariti PDF iz koda na zadatom mestu

[es] :: Access :: Kako otvariti PDF iz koda na zadatom mestu

[ Pregleda: 1781 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

Zidar
Canada

Moderator
Član broj: 15387
Poruke: 3085
*.100.46-69.q9.net.



+79 Profil

icon Kako otvariti PDF iz koda na zadatom mestu03.10.2012. u 21:07 - pre 140 meseci
Imam PDF dokumnet od 150,000 strana. Svaka strana predstavlja jedna dokument. Ne svakoj strani postoji devetocifreni broj, koji jednoznacno odredjuje stranu. Broj je odstampan u formatu "123-456-789". Moje pitanje je: kako otvoriti PDF iz Accesa, ako sam zadao path za PDF, na primer "C:\MyData\BigFile.PDF" i devetocifreni broj, na primer "308-427-911". Postoji tacno jedna strana u dokumentu na kojoj pise "308-427-911".

IMa li neko funkciju za ovo, sa parametrima?

Uspeo sam da otvorim dokument na zadatoj stranici, ali ovode mi treba otvaranje na zadatom string.
Code:

Function Open_PDF_Page(strPath As String, intPageNum As Integer) As Boolean

Dim strReader As String
Dim strShell As String

'Loaction of Adobe Exe, i ovo bi mogao da bude parametar
strReader = "C:\Program Files (x86)\Adobe\Acrobat 10.0\Acrobat\Acrobat.exe /A"

'This works, but no page 4:
'strShell = """" & strReader & """ /A ""page=" & intPageNum & """ """ & strPath & """"

'This works and opens the document on given page:
strShell = strReader & " page=" & CStr(intPageNum) & " " & """" & strPath & """"

Debug.Print "strShell: " & strShell
Shell strShell, vbNormalFocus

End Function


'Ovo otvara PDF na strani 2, provereno, radi:
? Open_PDF_Page("J:\Policies and Procedures\BarCodes\BarCodeSpecs\BarcodeGeneration_Guidelines.pdf",2)



 
Odgovor na temu

Zoran.Eremija
Zoran Eremija
SYSTEM ANALYST
Freelancer
Beograd

Član broj: 251342
Poruke: 855
212.178.245.*

Sajt: zoraneremija.wix.com/erem..


+47 Profil

icon Re: Kako otvariti PDF iz koda na zadatom mestu03.10.2012. u 22:10 - pre 140 meseci
Postovani kolega, pokusajte sa sledecom komandnom linijom

c:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe /A "zoom=50&navpanes=1=OpenActions&search=308-427-911" J:\Policies and Procedures\BarCodes\BarCodeSpecs\BarcodeGeneration_Guidelines.pdf

 
Odgovor na temu

Zidar
Canada

Moderator
Član broj: 15387
Poruke: 3085
*.100.46-69.q9.net.



+79 Profil

icon Re: Kako otvariti PDF iz koda na zadatom mestu04.10.2012. u 15:21 - pre 140 meseci
Zhavlajujem, radi. Majstor je majstor :-)

Code:

Function Open_PDF_Page(strPath As String, intPageNum As Long) As Boolean
'---------------------------------------------------------------------------------------
' Procedure : Open_PDF_Page
' Author    : Zidar, uz pomoc Z.Eremije
' Date      : 04-Oct-2012
' Purpose   : Opens PDF file, given as strPath, na page intPageNum
' Based on  : http://wwwimages.adobe.com/www...t/pdfs/pdf_open_parameters.pdf
'
' Example: ? Open_PDF_Page(strPath:="J:\DI\REceivedFromVendor\isr_36e_001.pdf",intPageNum:=5)
'---------------------------------------------------------------------------------------
'

Dim strReader As String
Dim strShell As String

'Loaction of Adobe Exe, i ovo bi mogao da bude parametar
On Error GoTo Open_PDF_Page_Error

'this should eb paremtrized as well!
strReader = "C:\Program Files (x86)\Adobe\Acrobat 10.0\Acrobat\Acrobat.exe /A"

'This works, but no page 4:
'strShell = """" & strReader & """ /A ""page=" & intPageNum & """ """ & strPath & """"

'This works and opens the document on given page:
strShell = strReader & " page=" & CStr(intPageNum) & " " & """" & strPath & """"

Debug.Print "strShell: " & strShell
Shell strShell, vbNormalFocus

EXIT_HERE:
   On Error Resume Next
   Exit Function

Open_PDF_Page_Error:
  Select Case Err
  Case Else
    MsgBox "Error " & Err.Number _
          & " (" & Err.Description _
          & ") in procedure Open_PDF_Page of Module modOpenPDF"
  End Select
  Resume EXIT_HERE



End Function

Function Open_PDF_Search(strPath As String, strSearch As String) As Boolean
'----------------------------------------------------------------------------------------------------------------------
' Procedure : Open_PDF_Search
' Author    : Zidar, uz pomoc Z.Eremije
' Date      : 04-Oct-2012
' Purpose   : Open PDF given as strPath, on position given as  strSearch
' Based on  : http://wwwimages.adobe.com/www...t/pdfs/pdf_open_parameters.pdf
'
' Example: Open_PDF_Search(strPath:="J:\DI\REceivedFromVendor\isr_36e_001.pdf",strSearch:="442-427-365")
'----------------------------------------------------------------------------------------------------------------------
'

Dim strReader As String
Dim strShell As String

'Loaction of Adobe Exe
On Error GoTo Open_PDF_Search_Error

'Again, hardcodded path for Adobe, not good, should be parametrized
strReader = "C:\Program Files (x86)\Adobe\Acrobat 10.0\Acrobat\Acrobat.exe /A"

'This works and opens for given search:
'strShell: C:\Program Files (x86)\Adobe\Acrobat 10.0\Acrobat\Acrobat.exe /A   "zoom=50&navpanes=1=OpenActions&search=276-910-395" J:\DI\Grade 3 and Grade 6\Gr3&6 - 2011-2012\Reporting\ISR\REceivedFromVendor\5Sept2012\isr_36e_001.pdf
'strShell = strReader & "   " & """" & "zoom=75&navpanes=1=OpenActions&search=" & strSearch & """" & " " & strPath

strShell = strReader & "   " & """" & "zoom=75&navpanes=1=Actions&search=" & strSearch & """" & " " & strPath

Debug.Print "strShell: " & strShell
Shell strShell, vbNormalFocus

EXIT_HERE:
   On Error Resume Next
   Exit Function

Open_PDF_Search_Error:
  Select Case Err
  Case Else
    MsgBox "Error " & Err.Number _
          & " (" & Err.Description _
          & ") in procedure Open_PDF_Search of Module modOpenPDF"
  End Select
  Resume EXIT_HERE

End Function


 
Odgovor na temu

[es] :: Access :: Kako otvariti PDF iz koda na zadatom mestu

[ Pregleda: 1781 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.