Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 23-04-2007, 04:59 PM
New kid on the block
 
Join Date: Apr 2007
Location: KL
Posts: 7
Rep Power: 0
Chubby21 is on a distinguished road
Text searching

im newbie here.. nak tanya pada pakar2 yg ade kat sini..
sekarang ni saya guna ASP..

saya nak cari perkataan dalam pdf file, guna ASP.. how to do? saya tengah download PDF SDK.. tp x tau la betul ke step saya ni..

contoh: bila taip "hello", system akan baca text dlm pdf dan show pdf file mana yang ade "hello"

urgent ni..plz help..tq (sorry kalau issue ni dah dipost sblm ni)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 27-04-2007, 04:51 PM
New kid on the block
 
Join Date: Apr 2007
Location: KL
Posts: 7
Rep Power: 0
Chubby21 is on a distinguished road
memandangkan tiada sape reply, biar aku reply sendiri..haha

dapat satu solution.. download converter nyer DLL ..meaning convert pdf tu ke text, then wat serching..
prob is, dll ni kena beli plak.. skrg try trial dia..tengah cari free nye..
or korang2 yg lain ade cara lain..juz shoot!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 27-04-2007, 05:40 PM
mysticmind's Avatar
Super Moderator
 
Join Date: Jun 2001
Location: Mystic Kingdoms
Posts: 2,619
Rep Power: 141
mysticmind will become famous soon enough mysticmind will become famous soon enough
Send a message via Yahoo to mysticmind
1 - susah nak jumpa pakar2 ASP.
2 - soalan anda agak sukar difahami.
3 - banyak orang kerja dalam enviroment php + mysql yang mmg biasa dengan baca pdf.
4 - jarang2 orang nak buat asp baca pdf.

Anyway, thank for sharing. mungkin ada orang lain mencuba benda ni.
__________________
Personal's Blog! - Malaysian Artist!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 29-04-2007, 02:14 AM
genzy's Avatar
Nowhere Webmaster
 
Join Date: Aug 2006
Location: Malaysia
Posts: 1,581
Rep Power: 56
genzy is on a distinguished road
Quote:
Originally Posted by Chubby21 View Post
im newbie here.. nak tanya pada pakar2 yg ade kat sini..
sekarang ni saya guna ASP..

saya nak cari perkataan dalam pdf file, guna ASP.. how to do? saya tengah download PDF SDK.. tp x tau la betul ke step saya ni..

contoh: bila taip "hello", system akan baca text dlm pdf dan show pdf file mana yang ade "hello"

urgent ni..plz help..tq (sorry kalau issue ni dah dipost sblm ni)
If the Acrobat reader is installed, when pdf is opened via the web browser, the is a mini toolbar provided by the Acrobat reader that has a search capability. For example, to search "hello" by typing "hello" as a search string, it will highlight all locations of "hello".
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 29-04-2007, 09:59 PM
New kid on the block
 
Join Date: Apr 2007
Location: KL
Posts: 7
Rep Power: 0
Chubby21 is on a distinguished road
Quote:
Originally Posted by genzy View Post
If the Acrobat reader is installed, when pdf is opened via the web browser, the is a mini toolbar provided by the Acrobat reader that has a search capability. For example, to search "hello" by typing "hello" as a search string, it will highlight all locations of "hello".
firstly, thanks pada sapa2 yang jawab..

senario is, im trying to develop some kind of knowledge base..ala-ala la..hehe. so when user key in 'hello', wat happen is system will open all find that stored in one specific path ..like C:\\my doc..then the system will read n search that 'hello'..

so en.Genzy, wat do u mean if the acrobat reader is installed? and i dont actually open the pdf file in web browser?..can xplain a bit?

tq..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 09-05-2007, 11:34 AM
New kid on the block
 
Join Date: Apr 2007
Location: KL
Posts: 7
Rep Power: 0
Chubby21 is on a distinguished road
akhirnya, solution nye, beli dll yang lain...
yang ni x payah extract dulu pdf tu, terus je wat searching..
tp harga dia x tau..hehe
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 09-05-2007, 03:43 PM
genzy's Avatar
Nowhere Webmaster
 
Join Date: Aug 2006
Location: Malaysia
Posts: 1,581
Rep Power: 56
genzy is on a distinguished road
For References:

Unable To Access Objects In Visual Basic
Code:
Dim avdoc as Object, app as object, pddoc as Object
set app = CreateObject("AcroExch.App")
set avdoc = CreateObject("AcroExch.AVDoc")
avdoc.open "c:\test.pdf", "Temp Title"

if (avdoc.IsValid = True) Then
set pddoc = avdoc.GetPDDoc()
End If
Automation of Acrobat with VBA - dBforums
Code:
I use this class to merge PDF files using Acrobat be sure to set a reference to "Adobe Acrobat x.x Type Library"

'---------------- START CODE --------------------------------------------------------
Option Compare Database
Option Explicit

Private colDOCS As Collection 'PDF Files to merge
Private strDestination As String 'Destination PDF Doc.
Private bolDeleteCoverPage As Boolean

Sub AddFile(strNewData As String)
colDOCS.ADD strNewData
End Sub

Sub ClearFileList()
'PURPOSE: remove Files in Collection. Set Collection to nothing and reinitalize
If Not colDOCS Is Nothing Then Set colDOCS = Nothing
Set colDOCS = New Collection
End Sub

Property Let Destination(strDest As String)
strDestination = strDest
End Property

Function Merge() As Long
On Error GoTo Proc_Error
Dim objAcroApp As Acrobat.CAcroApp
Dim objAcroDoc As Acrobat.CAcroPDDoc
Dim objAcroDocSrc As Acrobat.CAcroPDDoc
Dim lngRetVal As Long
Dim I As Long
Dim lngPage As Long

Set objAcroApp = CreateObject("AcroExch.App")
Set objAcroDoc = CreateObject("AcroExch.PDDoc")
Set objAcroDocSrc = CreateObject("AcroExch.PDDoc")

lngRetVal = objAcroDoc.Open(colDOCS.Item(1))
lngPage = objAcroDoc.GetNumPages

For I = 2 To colDOCS.Count
lngRetVal = objAcroDocSrc.Open(colDOCS.Item(I))
If lngRetVal = False Then
MsgBox ("Error Opening " + colDOCS.Item(I))
Merge = False
GoTo Proc_Exit
End If
Merge = objAcroDoc.InsertPages((lngPage - 1), objAcroDocSrc, 0, objAcroDocSrc.GetNumPages, False)
lngPage = lngPage + objAcroDocSrc.GetNumPages
objAcroDocSrc.Close
Next I
objAcroDoc.CreateThumbs 0, lngPage - 1

Merge = objAcroDoc.Save(PDSaveFull, strDestination)

objAcroDoc.Close
objAcroApp.Exit
Proc_Exit:

If Not objAcroApp Is Nothing Then Set objAcroApp = Nothing
If Not objAcroDoc Is Nothing Then Set objAcroDoc = Nothing
If Not objAcroDocSrc Is Nothing Then Set objAcroDocSrc = Nothing
Exit Function
Proc_Error:
MsgBox Err.Description
Merge = Err.Number
Resume Proc_Exit
End Function

Private Sub Class_Initialize()
Set colDOCS = New Collection
End Sub
Private Sub Class_Terminate()
On Error Resume Next
If Not colDOCS Is Nothing Then Set colDOCS = Nothing
End Sub
Quote:
Use the code provided above. The key is that it uses a collection to contain the list of files you want to combine.

So, your fist step is to clear the collection.
You then add the file-names (full path) to the collection.
You then specify a destination file name.
Finally you call merge.
To be tidy, you probably should clear the collection when you're done.

Assuming you had 3 pdfs with the names test1-3 in c:\pdftest, you could use this procedure to merge them.

Sub test()
ClearFileList
Destination = "c:\pdftest\foo.pdf"
AddFile "C:\pdftest\test1.pdf"
AddFile "C:\pdftest\test2.pdf"
AddFile "C:\pdftest\test3.pdf"
Merge
End Sub

And thank you, to Jose for an excellent bit of code.
Adobe Acrobat automation with VB and Windows API
Code:
    
' Declaration
    Structure Rect
        Dim Left As Integer
        Dim Top As Integer
        Dim Right As Integer
        Dim Bottom As Integer
    End Structure

    Declare Function GetWindow Lib "user32" (ByVal hwnd As Integer, ByVal wCmd As Integer) As Integer
    Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Integer, ByVal hWndInsertAfter As Integer, ByVal x As Integer, _
        ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer
    Declare Function GetClientRect Lib "user32" (ByVal hwnd As Integer, ByRef lpRect As Rect) As Integer
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
    Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Integer, ByVal hWndNewParent As Integer) As Integer
    Private Declare Function GetWindowRect Lib "user32" (ByVal Hwnd As Integer, ByRef lpRect As Form1.Rect) As Integer
    Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Integer) As Integer
    Private Declare Function MoveWindow Lib "user32" (ByVal Hwnd As Integer, ByVal x As Integer, ByVal y As Integer, _
        ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal bRepaint As Integer) As Integer

    Private AcroHandle As Integer
    Private AcroXApp As Acrobat.CAcroApp
    Private AcroXAVDoc As Acrobat.CAcroAVDoc
    Private AcroXPDDoc As Acrobat.CAcroPDDoc
    Private FormApp As AFORMAUTLib.AFormApp
    Private AcroForm As AFORMAUTLib.Fields
    Private Field As AFORMAUTLib.Field

' Methods
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim FileName As String
        AcroXApp = CType(CreateObject("AcroExch.App"), Acrobat.CAcroApp)
        'Removing toolbar buttons from the user interface
        With AcroXApp
            .ToolButtonRemove("Save")
            .ToolButtonRemove("Open")
            .ToolButtonRemove("AcroForm:WidgetTool")
        End With
        AcroXAVDoc = CType(CreateObject("AcroExch.AVDoc"), Acrobat.CAcroAVDoc)
        FileName = "C:\'Your path and pdf file name'"
        AcroXAVDoc.Open(FileName, "Acrobat")
        AcroHandle = FindWindow(vbNullString, "Adobe Acrobat Professional - [Acrobat]")
        SetParent(AcroHandle, Panel1.Handle.ToInt32) 'put Acrobat in winform panel.  The panel is docked to all four sides of the form.  In VB6 you need to resize the panel with the form
        'Show in winform (not in a panel) alternative to above:
        'AcroXAVDoc.OpenInWindowEx(FileName, Me.Panel1.Handle.ToInt32, 1, 1, 0, 0, 2, 0, 0, 0)
        'I've found this is not as flexible
        'The following is to fill Acrobat fields with data
        AcroXPDDoc = CType(AcroXAVDoc.GetPDDoc, Acrobat.CAcroPDDoc)
        FormApp = CType(CreateObject("AFormAut.App"), AFORMAUTLib.AFormApp)
        AcroForm = CType(FormApp.Fields, AFORMAUTLib.Fields)
        For Each Field In AcroForm
            Field.Value = "This is a test of how well this works, and if I have this right, I can be happy."
        Next
        AcroXPDDoc.ClearFlags(&H1) 'Keep Acrobat from querying a file save when component closes
        SetAcroSize(AcroHandle, Panel1)
        AcroXApp.Show()

    End Sub

    Private Sub SetAcroSize(ByRef lngHwnd As Integer, ByRef AcroPanel As System.Windows.Forms.Panel)

        'Hide the title bar and menus from the user
        'and resize Acrobat with the resizing of the form
        Dim lngX As Integer 'acro left position
        Dim lngY As Integer 'acro top position
        Dim lngW As Integer 'acro width
        Dim lngH As Integer 'acro height
        Dim AppRect As Form1.Rect
        GetWindowRect(AcroPanel.Handle.ToInt32, AppRect)
        lngX = -GetSystemMetrics(32)
        lngY = -GetSystemMetrics(33) - 37
        lngW = AppRect.Right - AppRect.Left - lngX * 2
        lngH = AppRect.Bottom - AppRect.Top - lngY * 2 - 37
        MoveWindow(lngHwnd, lngX, lngY, lngW, lngH, 1)

    End Sub

    Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize

        SetAcroSize(AcroHandle, Panel1)

    End Sub

    Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed

        'If acrobat is not properly closed, you end up with the acrobat.exe process continuing to run, 
        'but Acrobat will not be visible.  This will baffle you to no end until you "end process" 
        'with Windows task manager while testing your app.
        AcroXApp.Hide()
        SetParent(AcroHandle, 0)
        AcroXAVDoc.Close(0)
        AcroXApp.CloseAllDocs()
        AcroXApp.Exit()

    End Sub
Is there a way to automate pdf/email process - ITtoolbox Groups
Code:
Private Sub Command1_Click()
'Declare acrobat objects and other variables
Dim gApp As Object    'Acrobat.CAcroApp
Dim AcroExchAVDoc As Object    'CAcroAVDoc
Dim AVPage As Object         'CAcroAVPageView
Dim bOK, bFound As Boolean
Dim i As Long, lngPage As Long
Dim lngAnswer As Long

'Create the Acrobat objects.
Set gApp = CreateObject("AcroExch.App")
Set AcroExchAVDoc = CreateObject("AcroExch.AVDoc")
gApp.Show

bOK = AcroExchAVDoc.Open("C:\My Documents\MyPDFs\STRUTS.pdf", "")

If (bOK) Then
bFound = AcroExchAVDoc.FindText("Reinstall", True, True, True)
If (bFound) Then
Set AVPage = AcroExchAVDoc.GetAVPageView
lngPage = AVPage.GetPageNum
MsgBox ("Text found on this Page: " & (lngPage + 1))
Set AVPage = Nothing
End If
Else
lngAnswer = MsgBox("Text Not Found!!!", vbCritical, "Text Not Found")
End If
Stop
AcroExchAVDoc.ClearSelection
AcroExchAVDoc.Close 1
Set AcroExchAVDoc = Nothing

'Quit Acrobat.
gApp.Exit
End Sub
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching for stall to rent? Aunty Nat Mamak Stall 1 20-11-2005 09:45 PM
searching for asp.net project lighching Other Webmaster-related Services and Promotion 2 05-08-2005 01:31 PM
Searching for shopping cart K-C E-Commerce 15 19-07-2005 09:55 PM
Searching for JOBS? JobListed Websites Review and Suggestion 0 17-05-2005 04:58 PM
searching..... nurulmajdi Website Programming 1 01-03-2004 06:15 PM



All times are GMT +8. The time now is 07:04 PM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59