Getdata count the number of pages in a PDF file - vba

I am currently trying to write some code to pull some data from some PDF files. I have used record macro to get the required power query lines correct and that's not an issue. My issue is that the number of pages in each PDF file changes. When I run power query through the get data on the data tab, you can see in this example there are 7 pages. I need a way to set a variable to 7, so I can update my for loop for each page.
Is this possible? Surely it is because getdata knows there are 7 pages. I don't have Adobe Acrobat Pro, and all solutions look at using Acrobat to open the file to then count. All solutions I've tried result in ActiveX 429 error, as I don't have Acrobat.
I have tried all the codes that involve opening the PDF with acrobat and also using word as an intermediary (often page count is incorrect)

Related

Can you embed a separate pdf into Indesign and open it after exporting to PDF?

I would like to ask the following if possible. We have a client that wants a separate pdf document, embedded in a main pdf document and opens when you click it. Like the function in MS Word where you can attach another Word document inside a Word document (Word-ception, lol) and you can still open it.
I've tried it in Acrobat Pro with the Attachment and Link tools. Another option was to put the link document in an ftp server for accessibility. but our client really wants this functionality. Is this possible in Indesign?
Thank you!
Using Word as your example vehicle there are several ways to link 2 documents.
One is an appendix to the other, in PDF terms is a merge or binding but its one flowing document with separate sequential sections/chapters.
Another way is to link to an external file, in PDF terms a hyperlink to a relative second file, which can be locally folder relative or a web absolute reference. You have tried that.
In Word we can add objects internally with icons, in PDF that can be an annotation comment attachment to save externally and action accordingly. You also seem to discount that approach.
Finally PDF offers an Adobe Specific Structure where multiple PDFs attachments can be imbedded in an overall PDF wrapper. These are called Portfolios and not! to be confused with their portfolio service
They are unpopular since in a browser without Adobe Reader they should only offer the cover page.
Whilst in securer offline readers the files may well be shown as attachments that you need to save or independently open to view them.
Only some non Acrobat viewers may view them as a collection. And in the past that required runing insecure SWFlash, But I understand that has changed ?
Here is how the 3 internal PDF files seen above were shown in older Acrobat 9.
Possibly the best experience is using Foxit Reader

Automating Split, Save Name and Error Checking with Acrobat Action Scripts?

I'm considering convincing my company to upgrade to Acrobat Pro so I can automate the processing of my scanned documents. Before I bring it up, I want to make sure the things I want to do are possible. I don't need anyone to give me the code, I just want to know if this is possible.
The documents i'm working with are landscape, 2-5 pages, and have the filename and page numbers in the footer. I want to scan a big stack of them and have a script perform the following actions:
Use OCR to acquire the filename and page numbers for each page. I would like to restrict the OCR to only look at the footer to save time and RAM.
Using the filenames, I want it to detect when one document ends and the next one begins so they can be split into separate files.
Before saving the split files, check that the number of pages in the file matches the page total in the footer. (I work in a factory and the documents can get sticky, so my scanner frequently pulls two pages at once)
Instead of saving the files where the page total doesn't match, compile a list of the errors so I know which documents need to be rescanned.
Finally, save all correct documents with their filenames from the footer to a folder on my desktop.
This could save me hours a week, so I'm hopeful that it's all possible. Thanks

Error When Importing PDF into Word

I need to perform multiple edits in a word document and based on search criteria then import the relevant PDF for that specific page. The file path I dynamically create as per specific data on the various pages. The code works fine if there are less that roughly 70 PDF files to import.
Once it gets to importing after around 70 PDF files then Word starts to give warning about not being able to undo the action which is about to be performed, even though i clear the Undo History after I have imported each PDF.
Then there is also an error which comes up with regards to the importing of the PDF, see image below:
But I can still open PDF document when this error occurs, if I stop my code and try to manually import the PDF it doesnt work. Only if I save the word document and then reopen it, can I import PDF documents into the word document again.
I believe it has something to do with all the actions being performed in Word.
Unfortunately I am not able to create a demo code which will give the same outputs for this question.
Why would PDF documents give an error when importing into Word?

Is it possible to create fillable PDF from excel?

Currently, I have an excel file that upon launch it shows a userform where users can fill out a few text boxes/comboboxes and press create. Upon pressing create, it gathers stored data and creates a PDF that we send to vendors. It's essentially an invoice. The vendors that receive this PDF have to fill out a couple of lines and return it to us. Right now if they have no acrobat/reader experience, they're printing the PDF and then scanning and returning to us.
I want the vendors to be able to type in a few areas on the PDF and return it to us. My question is, can I create a fillable PDF from excel? Does anyone know how to do this using excel features or with VBA? Or any other method?
Thanks!
Brandon
Short Answer: Absolutely.
First you will start with a fillable pdf form. (you can create one using Adobe Acrobat or the older Adobe Designer)
It is my understanding, from your question that you would like to take some information, fill out a PDF, then send this to your client, to complete this.
Using VBA you can do all of this in one single button.
I created a step-by-step video on how to use the SendKeys method to achieve this.
Please see the detailed instructional YouTube video here: How to AUTOMATICALLY fill PDF forms using Microsoft Excel in 1 CLICK

PDF downloading instead of opening in new tab

This is not a back-end programming question. I can only modify the markup or script (or the document itself). The reason I'm asking here is because all my searches for appropriate terms inevitably lead to questions and solutions about programming this functionality. I'm not trying to force it via progrmaming; I have to find out why this PDF is behaving differently.
So:
I have a bunch of links to PDFs on a page. Most of them open in new tabs, but one of them, the most recent, starts to open in a tab, but then the tab closes and the PDF gets downloaded as a file instead. All markup is consistent - there's nothing differnt about the odd-man-out except the actual URL.
You can see this here:
http://calwater.mwnewsroom.com/Investor-Relations/Financial-Reports/Annual-Reports
All annual reports up to 2012 open in a new tab, but 2013 downloads instead.
This leads me to believe that there is some meta-data property of the PDF itself that tells it how to open, and that, in this case, the 2013 PDF was created using different settings.
Apparently, the PDF was saved out to PDF from InDesign.
Does anyone have any insight?
Problem solved. There was simply an error in the string (like an extra period) that references the attachment such that it couldn't tell it was a PDF. Fixing the reference fixed the problem.