Author | Topic: Names of the field or tags for a PDF file with AX VBA | |
---|---|---|
=?UTF-8?Q?C=c3=a9sar_Calvo?= | Names of the field or tags for a PDF file with AX VBA on Sat, 26 May 2018 04:27:48 +0200 Hello. With this code a PDF file is opened: oPDF := CreateObject("AcroExch.PDDoc") IF oPDF:Open("D:\CCC_PROGRAMACION\APP_SDI_LAHIGUERA\OFE924774.pdf") Infobox("The PDF is opened") oPDF:close() oPDF:Destroy() ELSE Infobox("The PDF isn´t opened") ENDIF I am trying to get the names of the files row by row of the attachment PDF. Here is an interesting article: https://www.excelguru.ca/forums/showthread.php?6994-VBA-interacting-with-PDF If (bOK) Then Set AFORMAUT = CreateObject("AFormAut.App") Set FormFields = AFORMAUT.Fields For Each FormField In FormFields With FormField sFieldName = .Name If .IsTerminal Then If sFields = "" Then sFields = .Name sTypes = .Type Else sFields = sFields + "," + .Name sTypes = sTypes + "," + .Type End If End If End With Next FormField Does anybody knows how do it? Thanks. OFE924774.pdf | |
Andreas Gehrs-Pahl | Re: Names of the field or tags for a PDF file with AX VBA on Sat, 26 May 2018 04:45:01 -0400 César, >I am trying to get the names of the files row by row of the attachment PDF. The attached PDF doesn't contain any Form Fields, so you can't get their name, type or content. This PDF file was programmatically created, using "IBM afp2pdf Transform Version: 1.6.0" using "[ClibPDF Library 2.02-r1-2] 1.6.0 AIX", so it (almost certainly) never included any Form Fields. This PDF isn't designed to programmatically extract any data. You might be able to extract the text with the appropriate tools, but it won't be in a structured format. There are many tools to manipulate PDFs, including Adobe Acrobat Reader. Just google AcroPDTextSelect for more info on how to use this. Hope that helps, Andreas Andreas Gehrs-Pahl Absolute Software, LLC phone: (989) 723-9927 email: Andreas@AbsoluteSoftwareLLC.com web: http://www.AbsoluteSoftwareLLC.com [F]: https://www.facebook.com/AbsoluteSoftwareLLC | |
=?UTF-8?Q?C=c3=a9sar_Calvo?= | Re: Names of the field or tags for a PDF file with AX VBA on Sat, 26 May 2018 11:48:56 +0200 El 26/05/2018 a las 10:45, Andreas Gehrs-Pahl escribió: > César, > >> I am trying to get the names of the files row by row of the attachment PDF. > > The attached PDF doesn't contain any Form Fields, so you can't get their > name, type or content. This PDF file was programmatically created, using > "IBM afp2pdf Transform Version: 1.6.0" using "[ClibPDF Library 2.02-r1-2] > 1.6.0 AIX", so it (almost certainly) never included any Form Fields. > > This PDF isn't designed to programmatically extract any data. You might be > able to extract the text with the appropriate tools, but it won't be in a > structured format. There are many tools to manipulate PDFs, including Adobe > Acrobat Reader. Just google AcroPDTextSelect for more info on how to use > this. > > Hope that helps, > > Andreas > Ok, understood but if I had a PDF that included what I said, as it would be with ActiveX? Thanks. | |
Andreas Gehrs-Pahl | Re: Names of the field or tags for a PDF file with AX VBA on Sat, 26 May 2018 07:45:55 -0400 César, >Ok, understood but if I had a PDF that included what I said, as it would >be with ActiveX? To manipulate PDF Form Fields, you probably need an add-on product, as the (free) Adobe Acrobat Reader doesn't include features to manage Form Fields programmatically (via Active-X), as far as I can tell. I use the X-Change PDF Viewer Active-X Control to manipulate Form Fields, basically using JavaScript. To use "AFormAut.App" you apparently need to have the full Adobe Acrobat (SDK) installed, not just the Adobe Acrobat Reader, as far as I know. I don't know if this has changed since Adobe Acrobat Reader Version 11, but prior versions wouldn't allow it. Hope that helps, Andreas Andreas Gehrs-Pahl Absolute Software, LLC phone: (989) 723-9927 email: Andreas@AbsoluteSoftwareLLC.com web: http://www.AbsoluteSoftwareLLC.com [F]: https://www.facebook.com/AbsoluteSoftwareLLC | |
Klaus Overhage | Re: Names of the field or tags for a PDF file with AX VBA on Tue, 29 May 2018 07:22:45 +0200 You can use the xpppdf tool form Edgar Borger (http://www.borger.com.br/softsupply/) or the foxit quick pdf library for this Am 26.05.2018 um 04:27 schrieb César Calvo: > Hello. > > With this code a PDF file is opened: > > oPDF := CreateObject("AcroExch.PDDoc") > > IF oPDF:Open("D:\CCC_PROGRAMACION\APP_SDI_LAHIGUERA\OFE924774.pdf") > > Infobox("The PDF is opened") > > oPDF:close() > oPDF:Destroy() > > ELSE > > Infobox("The PDF isn´t opened") > > ENDIF > > I am trying to get the names of the files row by row of the attachment PDF. > > Here is an interesting article: > > https://www.excelguru.ca/forums/showthread.php?6994-VBA-interacting-with-PDF > > > If (bOK) Then > Set AFORMAUT = CreateObject("AFormAut.App") > Set FormFields = AFORMAUT.Fields > For Each FormField In FormFields > With FormField > sFieldName = .Name > If .IsTerminal Then > If sFields = "" Then > sFields = .Name > sTypes = .Type > Else > sFields = sFields + "," + .Name > sTypes = sTypes + "," + .Type > End If > End If > End With > Next FormField > > Does anybody knows how do it? > > Thanks. |