Hello,
I hope that everything is going well with you all.
I have a code which can chose pdf clearly. However, my datas in PDF from text parts not from metada. So if I do this TextBox6.Value = acroPDDoc.GetInfo("Producer") then textbox filling as "Xyz". But I can't get the necessary information from here, such as length and weight. TextBox6 is a technical data as kVA in the PDF text section. As I understand PDF text section's type table. So I need to get the data from this table not from metada but my codes are work for metada.
So I need to fill the textbox as "400"
When I chose this PDF
Rated Power's value to TextBox6
Then result must be like :
Pdf text section which included necessary data like this:
Pdf metada like this:
I hope that everything is going well with you all.
I have a code which can chose pdf clearly. However, my datas in PDF from text parts not from metada. So if I do this TextBox6.Value = acroPDDoc.GetInfo("Producer") then textbox filling as "Xyz". But I can't get the necessary information from here, such as length and weight. TextBox6 is a technical data as kVA in the PDF text section. As I understand PDF text section's type table. So I need to get the data from this table not from metada but my codes are work for metada.
So I need to fill the textbox as "400"
When I chose this PDF
Rated Power's value to TextBox6
Then result must be like :
Pdf text section which included necessary data like this:
Pdf metada like this:
Title | |
Subject | |
Keywords | |
Author | |
Creator | |
Producer | Xyz |
CreationDate | Fri Dec 23 17:51:01 2022 |
ModDate | Fri Dec 23 17:55:55 2022 |
Tagged | no |
UserProperties | no |
Suspects | no |
Form | none |
JavaScript | no |
Pages | 2 |
Encrypted | no |
Page size | 595 x 842 pts (A4) |
Page rot | 0 |
File size | 317234 bytes |
Optimized | no |
PDF version | 1.4 |
VBA Code:
Private Sub CommandButton3_Click()
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
fd.Filters.Clear
fd.Filters.Add "PDF Files", "*.pdf"
If fd.Show = False Then Exit Sub
Dim acroApp As acroApp
Dim acroAVDoc As acroAVDoc
Dim acroPDDoc As acroPDDoc
Set acroApp = CreateObject("AcroExch.App")
Set acroAVDoc = CreateObject("AcroExch.AVDoc")
If acroAVDoc.Open(fd.SelectedItems(1), "") Then
Set acroPDDoc = acroAVDoc.GetPDDoc
Else
MsgBox "Error opening PDF file"
Exit Sub
End If
TextBox6.Value = acroPDDoc.GetInfo("Producer")
acroAVDoc.Close True
Set acroPDDoc = Nothing
Set acroAVDoc = Nothing
Set acroApp = Nothing
End Sub