Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Access PDF Documents

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Access PDF Documents

    I hope there is a simple solution to this one.

    I have many documents that are in PDF format. I need to be able to
    1. Prompt for a list of names stored in a folder, and
    2. Display a list of documents therein contained, and
    3. Return to the Main Menu, and either select another document or exit.

    I know it's possible. Stan Mathews originally wrote something for me when I was with the State but, it's been many years since Stan provided the code.

    Any help will be GREATLY appreciated.

    Thanks,

    Lar

    #2
    This should get you started. Not polished but you can tweak this to meet your needs.

    Code:
    'Create an XDialog dialog box to prompt for parameters.
    DIM SHARED vcPDF as c
    DIM SHARED varC_result as C
    ok_button_label = "&OK"
    cancel_button_label = "&Cancel"
    varC_result = ui_dlg_box("PDF Search",<<%dlg%
    {region}
    Type prompt here:| [%p=ui_get_file("","File Type (*.pdf)",vcPDF,"X");I=$a5_smart_file%.100vcPDF];
    {endregion};
    {line=1,0};
    {region}
    <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
    {endregion};
    %dlg%)
    
    'Open file: vcPDF.pdf
    if file.exists(vcPDF) then
        sys_open(vcPDF)
    else
        ui_msg_box("Error Opening File","File " + vcPDF + " does not exist.",ui_stop_symbol)
    end if
    
    ​
    Last edited by Ronald Anusiewicz; 10-08-2022, 10:49 AM. Reason: Changed 'Open file line
    Alpha 5 Version 11
    AA Build 2999, Build 4269, Current Build
    DBF's and MySql
    Desktop, Web on the Desktop and WEB

    Ron Anusiewicz

    Comment


      #3
      Ron,

      Thank you so much ! I think I will be able to move forward, WITH YOUR HELP !

      Lar

      Comment


        #4
        Ron,

        Just posted and tried your code but it now says "Script contains errors at line 23"

        ???

        Comment


          #5
          You need to show me your code as the script I gave you only has 21 lines.
          Alpha 5 Version 11
          AA Build 2999, Build 4269, Current Build
          DBF's and MySql
          Desktop, Web on the Desktop and WEB

          Ron Anusiewicz

          Comment


            #6
            Ron,

            I believe I found an errant ? on the last line. Must of been added in error. If I wanted to add a question in the code, is that simple enough ? Such as, show a list of the files that match a partial search ?

            Lar

            Comment


              #7
              One can do a search using the search box in the upper right hand corner of the file explorer.

              image.png
              Alpha 5 Version 11
              AA Build 2999, Build 4269, Current Build
              DBF's and MySql
              Desktop, Web on the Desktop and WEB

              Ron Anusiewicz

              Comment


                #8
                Well I know Browses are unfashionable, but may I suggest a Set with links on the user.
                People and PDF''s.
                Then 2 Browses on a Form, People list and corresponding PDF''s will be shown.
                You can scroll the people list or add a Search feature. When a person is selected, the corresponding PDF''s will present.
                click one of those and they will display.
                See our Hybrid Option here;
                https://hybridapps.example-software.com/


                Apologies to anyone I haven't managed to upset yet.
                You are held in a queue and I will get to you soon.

                Comment


                  #9
                  I believe this is what you want:

                  Code:
                  'SCRIPT VARIABLES
                  dim vLex as C=comma_to_crlf(".,..")
                  dim vroot_fldr as C="E:\Scans\Invoices"+chr(92) '<<< CHANGE THIS TO MATCH YOUR CIRCUMSTANCE
                  dim vroot_fldr_probe as C=vroot_fldr+"*.*"
                  dim vL1_fldr_list as C
                  dim vL1_fldr_probe as C
                  dim vL2_PDF_file_list as C
                  dim vfilename as C
                  
                  'DIALOG STRUCTURE
                  dim dlg_title as C=" SEARCH PDF FILES "
                  dim dlg_body as C
                  dim dlg_code as C
                  
                  'DIALOG FIELD VARIABLES
                  dim vL1_fldr_pick as C
                  dim vpdf_pick as C
                  
                  'BUILD DIALOG
                  dlg_body = <<%dlg%
                  {startup=init}{background=Light Tan}{xmargin=3,3}{ymargin=1,1}
                  
                  {comment= TOP BUTTONS}
                  {region}{justify=right}<%T=Open File;B=T;I=$$file.open%4,1!file_open>
                  {sp=3}<%T=Close Dialog;B=T;I=$$generic.exit%4,1!exit>
                  {endregion};{justify=left}
                  
                  {comment= LEVEL 1 FOLDERS }
                  {region}{font=arial,8,bi}{frame=1,1: Level 1 Folders }{font=Arial,10}
                  [.40,21vL1_fldr_pick^#vL1_fldr_list!evL1_*];
                  {endregion}
                  
                  {comment= LEVEL 2 PDF FILES }
                  {region}{font=arial,8,bi}{frame=1,1: Level 2 Files }{font=Arial,10}
                  [.90,21vpdf_pick^#vL2_PDF_file_list];
                  {endregion};{lf};
                  %dlg%
                  
                  'DIALOG CODE
                  dlg_code=<<%code%
                  'INIT
                  IF a_dlg_button="init"
                  vL1_fldr_list=filefind.get(vroot_fldr_probe,FILE_FIND_DIRECTORY)
                  vL1_fldr_list=word_subtract(vL1_fldr_list,vLex,crlf())
                  sys_send_keys("{HOME}")
                  a_dlg_button=""
                  END IF
                  
                  'ACTION FOR L1 FOLDER PICK >> GET PDF FILES IN SELECTED L1 FOLDER
                  IF left(a_dlg_button,5)="evL1_"
                  if a_dlg_button="evL1_change"
                  vL1_fldr_probe=vroot_fldr+vL1_fldr_pick+chr(92)+"*.pdf"
                  vL2_PDF_file_list=filefind.get(vL1_fldr_probe,FILE_FIND_NOT_DIRECTORY)
                  end if
                  a_dlg_button=""
                  END IF
                  
                  'OPEN SELECTED PDF FILE
                  IF a_dlg_button="file_open"
                  if vL1_fldr_pick<>"" .and. vpdf_pick<>""
                  vfilename=vroot_fldr+vL1_fldr_pick+chr(92)+vpdf_pick
                  sys_open(vfilename)
                  else
                  dlg_msg_box("ERROR","Selection of both Primary folder and a PDF file is required before opening")
                  end if
                  end if
                  
                  'EXIT
                  if a_dlg_button="exit"
                  ui_modeless_dlg_close(dlg_title)
                  end if
                  %code%
                  
                  'GENERATE DIALOG
                  vR=ui_modeless_dlg_box(dlg_title,dlg_body,dlg_code)​
                  Mike W
                  __________________________
                  "I rebel in at least small things to express to the world that I have not completely surrendered"

                  Comment


                    #10
                    Mike,

                    It sounds like exactly what I had in mind. I installed the software and attempted to run. The software runs but, there is no data. How do I get the data into the search folder ?

                    Thank you for your work on this !

                    Lar

                    Comment


                      #11
                      Lar,
                      From what you wrote, you seem to suggest you have a directory and file structure like below. For sake of explanation, I will arbitrarily assign that the NAMES folder is on the C:\ drive in a folder named MYAPP.. Therefore, the line 3 of the code I gave would be:
                      dim vroot_fldr as C="C:\MYAPP\NAMES"+chr(92)

                      NAMES
                      ..........|____Jim
                      ..........| ...........|___doc 1.pdf
                      ..........|............|___doc 2.pdf
                      ......... |........... |___doc 3.pdf
                      ..........|____Bill
                      ......................|___doc 1.pdf
                      ......................|___doc 2.pdf
                      ......................|___doc 3.pdf


                      Mike W
                      __________________________
                      "I rebel in at least small things to express to the world that I have not completely surrendered"

                      Comment


                        #12
                        Mike,

                        I had all of the pieces ready to upload to you and found out that Alpha does does cache the previous email.
                        So, I'll do it this way.

                        In pieces

                        Comment


                          #13
                          These are the first few lines that I modified:



                          dim vLex as C=comma_to_crlf(".,..")

                          ' dim vroot_fldr as C="E:\Scans\Invoices"+chr(92) '<<< CHANGE THIS TO MATCH YOUR CIRCUMSTANCE
                          dim vroot_fldr as C="C\LEGAL\client.dbf"+chr(92) 'Mike: Changes made here

                          dim vroot_fldr_probe as C=vroot_fldr+"*.*"
                          dim vL1_fldr_list as C
                          dim vL1_fldr_probe as C
                          dim vL2_PDF_file_list as C
                          dim vfilename as C

                          Comment


                            #14
                            Mike,

                            So, here's some actual data:

                            The structure is:

                            C:\LEGAL\CLIENT.DBF Larry Carraher
                            C:\LEGAL\SCANS\CASE123.PDF
                            C:\LEGAL\SCANS\CASE234.PDF

                            C:\LEGAL\CLIENT.DBF John Carraher
                            C:\LEGAL\SCANS\CASE345.PDF
                            C:\LEGAL\SCANS\CASE456.PDF
                            C:\LEGAL\SCANS\CASE567.PDF

                            Pretty much exactly as you had previously detailed

                            Should the file name (CLIENT.DBF) be defined that way ?

                            Comment


                              #15
                              Mike,

                              Last entry tonight, when executed, the system should display:

                              Larry CASE123
                              CASE234
                              John CASE345
                              CASE456
                              CASE567

                              When I select Larry, system should display CASE123 & CASE234 and display the PDF selected
                              And, when I select, if selected, John, the system should display the CASE345, CASE456, and CASE567 and whichever PDF I selected.

                              Thank you for your help today. You have made the issues understandable ! Thank you !

                              Lar

                              Comment

                              Working...
                              X