PDA

View Full Version : You know PDF .... how about FDF



doubtfire
09-05-2012, 06:02 PM
Does anyone has the experience of applying FDF using only Adobe Reader, NOT Adobe Acrobat ?
Please help if you DO.
Thanks. :help

Kenneth Hobs
09-05-2012, 06:50 PM
See: http://www.vbaexpress.com/forum/showthread.php?t=43290

doubtfire
09-05-2012, 08:08 PM
Thanks.:think:

jolivanes
09-05-2012, 09:37 PM
Googled and found this

http://www.excelhero.com/cgi-bin/mt/mt-search.cgi?blog_id=4&tag=FDF&limit=20

doubtfire
09-06-2012, 06:16 AM
Thanks.
I have tried and it seems some of the details part not mentioned.
If any one has the experience please throw some lines/details.
: pray2:

Kenneth Hobs
09-06-2012, 06:59 AM
What seems to be the problem? Did you download the example files from the link and run the macro in the example file? It may not be obvious, but they are in the .zip link in the 2nd paragraph from the bottom of the ExcelHero link.

The only difference with my code was that I made it open the file after creating the FDF file and save it as a PDF file using SendKeys(). If you have the FDF and the PDF form file, you really don't need to create the PDF file that is independent of the PDF form file.

The FDF macro is just replacing a word string with the field value from an Excel file.

To create the Form fields like in the IRS PDF file, you do need Adobe Acrobat.

doubtfire
09-06-2012, 07:03 AM
Ken,

Thank you again.

I would follow your previous instructions and test it.
Again salute for all your efforts.

doubtfire
09-06-2012, 12:15 PM
Ken,

I have been testing the code and it got always stuck at

"AppActivate rc, True" then go to the ErrorHandler.

Manually Save it is OK.

Thanks.:friends:

Kenneth Hobs
09-06-2012, 12:36 PM
Before that line, put:
Debug.Print s After running, in the Immediate Window, copy and paste that string into the Start > Run window and press OK. It should open the FDF file as if you had manually opened it.

It may be something simple like adding quotes around the FDF file name in the concatenated string value for the variable "s".

doubtfire
09-06-2012, 01:57 PM
Ken,

Thanks again.
The issue is because of the quotes not applied to the file name, actually you did put quotes to the Adobe Reader (.exe) but not to the last one AND unluckily the file name follows the Excel column name with has a space in between.
Second, I believe you were testing with the Adobe Acrobat which has (ALT-F) but not Adobe Reader which needs a (SHIFT-CTRL-S) to SaveAs.
Thank you again.
BTW, I might need you again when I switch to the .NET and XML for further exploration. :beerchug:

Kenneth Hobs
09-06-2012, 02:08 PM
This an Excel VBA forum so email or PM me if you want to ask me a .net or xml question. I am no expert but you can see from the WordPerfect post that .net can use some DLL routines to work with PDF and FDF. Lots of interesting things are possible with .net, the pdf DLL routines, and xml.

The AddQuotes() can be used for the filename. Acrobat, Adobe Reader, PDFill and others may well have other menu differences. The EXEPath() can be handy to determine which one might be associated and take action from there.

cheers

doubtfire
09-06-2012, 06:45 PM
Ken,

Still one more issue in regards to SaveAs the "PDF" file type.

After
AppActivate rc, True
Application.SendKeys "+^S" 'to SaveAs
Application.SendKeys "%n" 'to name
Application.SendKeys "PDFFile.pdf" 'for PDF name
Application.SendKeys "%S" 'to Save

1. Here I found out the name sometimes get truncated like original name is
"FFFilename1.pdf" becomes "Filename1.pdf"
then becomes ".pdf" (got truncated but it is saved)

2. Application.SendKeys "^Q" 'to quit Adobe
It does not work.

Any ideas.
Thanks.:banghead:

doubtfire
09-07-2012, 09:27 AM
I think I got the answer.

After
AppActivate rc, True
Application.SendKeys "+^S" 'to SaveAs
Application.Wait (Now + TimeValue("0:00:1"))
Application.SendKeys "%n" 'to name
Application.Wait (Now + TimeValue("0:00:1"))
Application.SendKeys "PDFFile.pdf" 'for PDF name
Application.Wait (Now + TimeValue("0:00:1"))
Application.SendKeys "%S" 'to Save

'******I put ONE big second for very move or action then the file will not be truncated

2. Application.SendKeys "^Q" 'to quit Adobe
It does not work.


When referring the Shortcut action like "CTRL+Q" in this case,
use

Application.SendKeys "^q" ' note "q" is used instead of "Q"

Thanks to all. :whistle:

Brodon
07-15-2013, 09:18 PM
I don't understand your information.Please explaine your topic clearly..........

Aussiebear
07-15-2013, 11:18 PM
Try re reading the thread again