Opening a PDF in BR
Moderators: Susan Smith, admin, Gabriel
Opening a PDF in BR
Can I open a PDF file in BR (Version?),
-
- Posts: 717
- Joined: Sun Aug 10, 2008 4:24 am
- Location: Southern California
Larry,
Do you want to OPEN a PDF file for editing, or could you possibly mean that you just want to DISPLAY a PDF file from within BR? You can do the second one, assuming that the user has a PDF reader installed.
OPTION 1
You can use a shell (system) call from within BR to execute the "PDF" filename itself (in which case, the file associations set up in Windows will launch whatever installed application is associated with the PDF file extension. This option is nice when you may not know what PDF reader is installed.
00010 EXECUTE "sys -c samplefile.pdf
OPTION 2
Or you can use the system call to load the reader program from the command line with the file name as a parameter. I don't have Adobe Reader installed on my computer and use Fox-it instead, so my command line would look like this:
00010 EXECUTE "sys -w -c """&"C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe"""&" samplefile.pdf"
In either of the cases above, you may have to verify that there is a PDF application installed. There are probably other options out there launching PDF files for display, but those are the ones that I've used. I don't know if BR's internal PDF handling has an option to display a file without an external PDF reader installed. Gordon could speak to this. I see that he's already addressed the issue of opening a PDF file for editing (which you can't do very easily).
-- Susan
Do you want to OPEN a PDF file for editing, or could you possibly mean that you just want to DISPLAY a PDF file from within BR? You can do the second one, assuming that the user has a PDF reader installed.
OPTION 1
You can use a shell (system) call from within BR to execute the "PDF" filename itself (in which case, the file associations set up in Windows will launch whatever installed application is associated with the PDF file extension. This option is nice when you may not know what PDF reader is installed.
00010 EXECUTE "sys -c samplefile.pdf
OPTION 2
Or you can use the system call to load the reader program from the command line with the file name as a parameter. I don't have Adobe Reader installed on my computer and use Fox-it instead, so my command line would look like this:
00010 EXECUTE "sys -w -c """&"C:\Program Files\Foxit Software\Foxit Reader\Foxit Reader.exe"""&" samplefile.pdf"
In either of the cases above, you may have to verify that there is a PDF application installed. There are probably other options out there launching PDF files for display, but those are the ones that I've used. I don't know if BR's internal PDF handling has an option to display a file without an external PDF reader installed. Gordon could speak to this. I see that he's already addressed the issue of opening a PDF file for editing (which you can't do very easily).
-- Susan
-
- Posts: 717
- Joined: Sun Aug 10, 2008 4:24 am
- Location: Southern California
-
- Posts: 717
- Joined: Sun Aug 10, 2008 4:24 am
- Location: Southern California
In the first (and second) example, the -c switch makes the program return to BR so BR can continue. But it should have (separately) opened the PDF in your PDF reader program, leaving it there until you manually close it. This works on my WinXP and Win7 machines (I just tested it). Do you have a PDF reader installed and is the .pdf file extension mapped to it? Here is an easy way to make this happen:
In Windows Explorer, navigate to a pdf file and right click on the file. Select OPEN WITH, choose your PDF reader application (you may have browse to it if it doesn't show up), and before clicking OK, check the box that tells you to "ALWAYS use this application with this file type" (or some similar verbage). From now on, all PDF files will be opened with that application unless you repeat the process above and select something else.
Try the first shell call again and see if it works now from BR.
As for the second option, I'm sure not what's going on. Can you open a PDF file in Adobe Acrobat if you select it in Windows Explorer rather than from within BR? In other words, is there some kind of installation issue going on with your reader? Or perhaps your system call line isn't correct. Try posting what you used here and we can dissect it.
-- Susan
In Windows Explorer, navigate to a pdf file and right click on the file. Select OPEN WITH, choose your PDF reader application (you may have browse to it if it doesn't show up), and before clicking OK, check the box that tells you to "ALWAYS use this application with this file type" (or some similar verbage). From now on, all PDF files will be opened with that application unless you repeat the process above and select something else.
Try the first shell call again and see if it works now from BR.
As for the second option, I'm sure not what's going on. Can you open a PDF file in Adobe Acrobat if you select it in Windows Explorer rather than from within BR? In other words, is there some kind of installation issue going on with your reader? Or perhaps your system call line isn't correct. Try posting what you used here and we can dissect it.
-- Susan
-
- Posts: 717
- Joined: Sun Aug 10, 2008 4:24 am
- Location: Southern California
johncarr's recommendation works just fine!!!!
Susan:
The quick open and close may be the result of some other parameter. I seem to recall a ways back you needed a parameter to keep the OS window open.
In option 2, the file runs just fine by clicking on the pdf. The open with settings are correct.
I have probably not been using the correct reply process or addressing br_forum directly.
Also can I change my user name?
Susan:
The quick open and close may be the result of some other parameter. I seem to recall a ways back you needed a parameter to keep the OS window open.
In option 2, the file runs just fine by clicking on the pdf. The open with settings are correct.
I have probably not been using the correct reply process or addressing br_forum directly.
Also can I change my user name?
I use an elegant solution for this, to store PDF copies of important documents in my office management software. I created an internal data file to store information about the document and a series of functions for working with the documents.
The internal data file has a few fields in it:
A Unique Key
The PDF File Name
The JPG Image Name
Date added
Source
Username Who Added
The important fields here are the first three. There is the Unique Key, which is a four digit alphanumeric incremented number, and is used wherever we're storing this document. For example an Expense in my SageLive system can have a scanned copy of the expense. The key for the document is placed in the expense data file so my software can see which document goes with which expense. An invoice has a rendered image of the invoice tied to it. A payment has a scanned copy of the check or an imported copy of the confirmation page showing its been paid.
Documents can come from my printer (via CutePDF), generated from the system itself (using Cute PDF or using BR's 4.2s new PDF file generation options), scanned in my scanner or be imported from data files. Image Files and PDF files are valid import file sources.
When a file is imported, no matter where it came from, I use a few command line programs to get it to the format I need. I have a command line program that scans a document on the scanner, a command line program that converts a pdf file to a jpg, one that uses QuickPDF to convert whatever is sent to the printer into a pdf file, and so on.
I use the jpg image to display the pdf file inside BR, so its part of my main BR window and doesn't appear in a seperate window. But if they click on the image, then it launches the original document in the default PDF reader for this system, like susan was saying. There's a seperate button for printing the original back to the printer.
So the simple answer to your questions is this: If you want your BR program to display a PDF file you have 2 options:
1) Launch a PDF viewer using the command line and use it to display the PDF file.
2) Use PDF2JPG, a command line program, to generate a JPG image of the PDF and display that JPG image in your BR program.
If its the text of the PDF that you need, i'm sure there is a command line program available to extract the text.. you just have to find one and experiment with it.
Gabriel
The internal data file has a few fields in it:
A Unique Key
The PDF File Name
The JPG Image Name
Date added
Source
Username Who Added
The important fields here are the first three. There is the Unique Key, which is a four digit alphanumeric incremented number, and is used wherever we're storing this document. For example an Expense in my SageLive system can have a scanned copy of the expense. The key for the document is placed in the expense data file so my software can see which document goes with which expense. An invoice has a rendered image of the invoice tied to it. A payment has a scanned copy of the check or an imported copy of the confirmation page showing its been paid.
Documents can come from my printer (via CutePDF), generated from the system itself (using Cute PDF or using BR's 4.2s new PDF file generation options), scanned in my scanner or be imported from data files. Image Files and PDF files are valid import file sources.
When a file is imported, no matter where it came from, I use a few command line programs to get it to the format I need. I have a command line program that scans a document on the scanner, a command line program that converts a pdf file to a jpg, one that uses QuickPDF to convert whatever is sent to the printer into a pdf file, and so on.
I use the jpg image to display the pdf file inside BR, so its part of my main BR window and doesn't appear in a seperate window. But if they click on the image, then it launches the original document in the default PDF reader for this system, like susan was saying. There's a seperate button for printing the original back to the printer.
So the simple answer to your questions is this: If you want your BR program to display a PDF file you have 2 options:
1) Launch a PDF viewer using the command line and use it to display the PDF file.
2) Use PDF2JPG, a command line program, to generate a JPG image of the PDF and display that JPG image in your BR program.
If its the text of the PDF that you need, i'm sure there is a command line program available to extract the text.. you just have to find one and experiment with it.
Gabriel
-
- Posts: 717
- Joined: Sun Aug 10, 2008 4:24 am
- Location: Southern California
Gabriel - I like the idea of saving the image as a JPG too so you can display it (or a thumbnail) in BR and then click to launch the PDF to display the larger PDF. Nice design!
Larry - you can't change a user name in the forum unfortunately. But you can create a second user name and I can delete the first one. Let me know if you plan to do that so I can watch for the notification. I get so many notifications of spammer bots trying to register in the forum EVERY SINGLE DAY (argh) that sometimes I delete the batch of them without checking (I try not to though). If I know it's coming, I'll be extra careful.
-- Susan
Larry - you can't change a user name in the forum unfortunately. But you can create a second user name and I can delete the first one. Let me know if you plan to do that so I can watch for the notification. I get so many notifications of spammer bots trying to register in the forum EVERY SINGLE DAY (argh) that sometimes I delete the batch of them without checking (I try not to though). If I know it's coming, I'll be extra careful.
-- Susan
John,
Use the BR forum so that others can benefit from your questions too.
I use a program called QuickScan. The free version puts a little tag in the scanned images, but you can register it for around $50 to get rid of the image tag.
It has lots of options to control the scanner and can scan from any scanner in the system by name, or the default scanner, or it can display a user interface and allow the end user to select the scanning options. It can scan to PDFs or JPGs and it can update existing PDF files to add pages to the end of them.
Gabriel
Use the BR forum so that others can benefit from your questions too.
I use a program called QuickScan. The free version puts a little tag in the scanned images, but you can register it for around $50 to get rid of the image tag.
It has lots of options to control the scanner and can scan from any scanner in the system by name, or the default scanner, or it can display a user interface and allow the end user to select the scanning options. It can scan to PDFs or JPGs and it can update existing PDF files to add pages to the end of them.
Gabriel
On Sat, Aug 13, 2011 at 4:31 PM, <johncarr@cakinc.com> wrote:
Gabriel,
Just curious, what command line program are you using for your scanning engine?
Thanks,
John
John Carr
Carr, Antley, Kellerhals, Inc.
130 Penmarc Drive
Suite 104
Raleigh, NC 27603
(919) 832-8994
Fax: (919) 832-4950
johncarr@cakinc.com
_______________________________________________
BR_forum mailing list
BR_forum@ads.net
http://box475.bluehost.com/mailman/list ... um_ads.net
I want to say this is it, although their website looks a bit suspicious to me now. http://www.pdftojpgconverter.com/ If this doesn't work, let me know and I'll send you my copy.
It's a diffferent appoach to displaying a PDF using a command line. I often need to display a PDF and sometimes I'm on a mchine that has Adobe Standard and sometimes Adobe reader, ech of which require a different command line. Plus the Adobe may be installed in other than the standard location. Of course even that can vary if you are in XP or Vista or Win 7.
So I use David Blankenship's registry reader to find the installed location of Adobe onthe machine. I first look for Adobe Standard, if that is not installed, and the reader will tell me this, I then look for Adobe Reader.
35270 IF POS(LWRC$(GETFILE$),".pdf") AND EXISTS(FNMSEXE$("acrobat.exe")) THEN !:
EXECUTE "sys -w -c "&FNMSEXE$("acrobat.exe")&" """&GETFILE$&"""" : GOTO 35330 !:
ELSE IF POS(LWRC$(GETFILE$),".pdf") THEN !:
EXECUTE "sys -w -c "&FNMSEXE$("acrord32.exe")&" """&GETFILE$&"""" !:
GOTO 35330
The above line does this for me using David's utility and a function in FNSNAP.dll called FNMSEXE
FNGeorge
So I use David Blankenship's registry reader to find the installed location of Adobe onthe machine. I first look for Adobe Standard, if that is not installed, and the reader will tell me this, I then look for Adobe Reader.
35270 IF POS(LWRC$(GETFILE$),".pdf") AND EXISTS(FNMSEXE$("acrobat.exe")) THEN !:
EXECUTE "sys -w -c "&FNMSEXE$("acrobat.exe")&" """&GETFILE$&"""" : GOTO 35330 !:
ELSE IF POS(LWRC$(GETFILE$),".pdf") THEN !:
EXECUTE "sys -w -c "&FNMSEXE$("acrord32.exe")&" """&GETFILE$&"""" !:
GOTO 35330
The above line does this for me using David's utility and a function in FNSNAP.dll called FNMSEXE
FNGeorge