Alpha DevCon 2018
Results 1 to 18 of 18

Thread: Combining PDF

  1. #1
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,001

    Default Combining PDF

    I have up to 20 pdf's which I need to combine into 1 master pdf.
    Using append_pdf does the append one at a time.
    What is the best way to list and process all 20 pdf's at once?
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/
    See our site for Alpha Support, Conversion and Upgrade.

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,998

    Default Re: Combining PDF

    pdf_append_list()
    There can be only one.

  3. #3
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,001

    Default Re: Combining PDF

    Thank you Stan.
    Each record has the required number of pdf's as individual fields so I will try to construct a list from the parent record to use.
    Then I can get the order correct - I hope.
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/
    See our site for Alpha Support, Conversion and Upgrade.

  4. #4
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,001

    Default Re: Combining PDF

    Well not actually that easy.
    I cannot find and Help references to pdf_append_list()
    Last edited by Al Buchholz; 07-06-2018 at 12:23 PM.
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/
    See our site for Alpha Support, Conversion and Upgrade.

  5. #5
    Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,481

    Default Re: Combining PDF

    Quote Originally Posted by Ted Giles View Post
    Well not actually that easy.
    I cannot find and Help references to pdf_append_list()
    google search

    https://www.google.com/search?q=pdf_...hasoftware.com

    found this.

    https://www.alphasoftware.com/docume...20Function.xml
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  6. #6
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,998

    Default Re: Combining PDF

    Which is pretty much like what the autocomplete supplies.

    Image 3.png

    The function does seem to want a crlf() delimited list as opposed to a comma separated list of values.
    There can be only one.

  7. #7
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,001

    Default Re: Combining PDF

    Thanks Gents, but the link says nowt I could not deduce.
    The auto fill does require a ctrllf () so itvends up as a string, not a list.
    I would prefer a simple list, possibly from Excel to populate the pdf append if possible.
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/
    See our site for Alpha Support, Conversion and Upgrade.

  8. #8
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,998

    Default Re: Combining PDF

    Each record has the required number of pdf's as individual fields so I will try to construct a list from the parent record to use.
    What are the field names?
    There can be only one.

  9. #9
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,001

    Default Re: Combining PDF

    Field names;
    contract
    disclosure
    utilities
    gas
    electric
    water
    commchg
    mortgage
    lein
    front
    back
    left
    right
    author
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/
    See our site for Alpha Support, Conversion and Upgrade.

  10. #10
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,998

    Default Re: Combining PDF

    Try this in the interactive window and see if you come up with a list of field contents suitable to feed to pdf_append_list().

    Code:
    pdfs = <<%fil%
    contract
    disclosure
    utilities
    gas
    electric
    water
    commchg
    mortgage
    lein 
    front
    back
    left
    right 
    author
    %fil%
    pdf_expr = ""
    for each foo in pdfs
    pdf_expr = pdf_expr+"alltrim("+foo.value+")"+"+"+quote("~")+crlf()
    next
    pdfsplus = rtrim(strtran(pdf_expr,crlf(),"+"),"+~")
    
    pdf_files = table.external_record_content_get("atest",pdfsplus,"","recno() = 1") 'change atest to your table name and choose a suitable record number
    pdf_files = strtran(pdf_files,"~",crlf())
    pdf_files = remove_blank_lines(pdf_files)
    ? pdf_files
    There can be only one.

  11. #11
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,001

    Default Re: Combining PDF

    Nope, I cannot get it to work Stan.
    Each of the fields is in a File Select option to capture the PDF from a different drive.

    So the record would read;
    Field 1 = House_Name = "Cedar Lodge"
    Field 2 = Contract" = "D:\HousingPDF\Cedar Lodge Contract.pdf"
    Filed 3 = Disclosure = "D:\HousingPDF\Cedar Lodge Disclosure.pdf"
    and so on.

    The message I get is that "variable pdf_files not found"
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/
    See our site for Alpha Support, Conversion and Upgrade.

  12. #12
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,998

    Default Re: Combining PDF

    That error message leads me to believe that the interactive editor is not the best place for you to test.

    Create a new script, xbasic, on the ocde tab, paste in what is above but substitute msgbox(pdf_files) in place of ? pdf_files. Try that.
    There can be only one.

  13. #13
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,001

    Default Re: Combining PDF

    Will do.
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/
    See our site for Alpha Support, Conversion and Upgrade.

  14. #14
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,001

    Default Re: Combining PDF

    Yes, Stan, that works.
    So now I see the list of files to process which is great but as a message box. Is the list persisted as a variable or as an array?
    Question.
    How should I represent that list in the pdf_append_list () code.
    Is it as simple as pdf_append_list (the code you sent )?
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/
    See our site for Alpha Support, Conversion and Upgrade.

  15. #15
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,998

    Default Re: Combining PDF

    Not quite that simple.

    You would need to decide how you want to filter the table.external_record_content_get(). I am guessing you want to view a record in a form. You don't mention any field as the key field so I'll use the house_name as an example. With a record visible on the form where the house_name is "Cedar Lodge" in the objectname house_name.

    Code:
    pdfs = <<%fil%
    contract
    disclosure
    utilities
    gas
    electric
    water
    commchg
    mortgage
    lein 
    front
    back
    left
    right 
    author
    %fil%
    pdf_expr = ""
    for each foo in pdfs
    pdf_expr = pdf_expr+"alltrim("+foo.value+")"+"+"+quote("~")+crlf()
    next
    pdfsplus = rtrim(strtran(pdf_expr,crlf(),"+"),"+~")
    
    pdf_files = table.external_record_content_get("atest",pdfsplus,"","house_name = "+s_quote(house_name.value)) 'change atest to your table name
    pdf_files = strtran(pdf_files,"~",crlf())
    pdf_files = remove_blank_lines(pdf_files)
    
    pdf_append_list(pdf_files,"specify full path-directory-filename.pdf here")
    There can be only one.

  16. #16
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,001

    Default Re: Combining PDF

    I follow you up to the last line.
    "specify full path-directory-filename.pdf here"
    Is this where the list will be stored, or is it a separate line for each pdf?
    What would the path look like, Stan?
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/
    See our site for Alpha Support, Conversion and Upgrade.

  17. #17
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,998

    Default Re: Combining PDF

    If you want to name the result file according to the house_name and store it in c:\temp
    Code:
    pdf_append_list(pdf_files,"c:\temp\\"+alltrim(house_name)"+".pdf")
    If you wanted to date stamp the file

    Code:
    pdf_append_list(pdf_files,"c:\temp\\"+alltrim(house_name)+"-"+dtoc(date(),"6-1")+".pdf")
    There can be only one.

  18. #18
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,001

    Default Re: Combining PDF

    Will try this first thing tomorrow.
    Many thanks for putting up with my soppy questions, Stan.
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/
    See our site for Alpha Support, Conversion and Upgrade.

Similar Threads

  1. combining applications
    By k4m1k4z3 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 6
    Last Post: 08-12-2009, 10:49 AM
  2. combining table
    By Susie in forum Alpha Five Version 7
    Replies: 4
    Last Post: 01-25-2006, 12:50 PM
  3. Combining data
    By Lamon Small in forum Alpha Five Version 6
    Replies: 2
    Last Post: 01-20-2005, 04:57 PM
  4. Combining two name fields
    By gwesley2000 in forum Alpha Five Version 5
    Replies: 4
    Last Post: 02-08-2003, 07:05 AM
  5. combining fields
    By John E Schultz in forum Alpha Four Version 6 and Prior
    Replies: 7
    Last Post: 03-08-2002, 05:30 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •