Announcement

Collapse
No announcement yet.

File Menu Expiration Date & Open PDF's that have a password

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

  • Pabox
    replied
    How is it goin people., hope any one has time to answer

    Hey any one can feed back please, using Fox Reader., How to print only 3 times., mo matter if the exe has been shared... how to achive this?

    Leave a comment:


  • Waldo
    replied
    Ulrich--I was finally able to finish the project!! But I would not have been able to do so without your patience, guidance and support. This message is a grateful thank you!! JimC

    Leave a comment:


  • Waldo
    replied
    Ulrich--thank you. I have been struggling with this---your advice is greatly appreciated and has re-energized me to successfully complete this project. Hope you had a great vacation. Take care. JimC

    Leave a comment:


  • Ulrich
    replied
    Hi Jim,

    Sorry for not jumping in earlier, I was on vacation for a month. I went back to the original project I posted in entry #24, and renamed the file from "Password_test.pdf" to "Password test.pdf". When I tested this, I got an error message. So I changed the code from

    Code:
    Shell.Execute("AutoPlay\\Docs\\SumatraPDF.exe", "open", "AutoPlay\\Docs\\Password test.pdf", "", SW_SHOWNORMAL, false);
    to

    Code:
    Shell.Execute("AutoPlay\\Docs\\SumatraPDF.exe", "open", "[highlight]\"[/highlight]AutoPlay\\Docs\\Password test.pdf[highlight]\"[/highlight]", "", SW_SHOWNORMAL, false);
    and it worked. The issue is that for some reason you need to add another string delimiter around the argument, to work around the space in the file name. Instead of the escaped quotes you can also use brackets, as shown here:

    Code:
    Shell.Execute("AutoPlay\\Docs\\SumatraPDF.exe", "open", [highlight][[[/highlight]"AutoPlay\\Docs\\Password test.pdf"[highlight]]][/highlight], "", SW_SHOWNORMAL, false);
    or single quotes, as shown here:

    Code:
    Shell.Execute("AutoPlay\\Docs\\SumatraPDF.exe", "open", [highlight]'[/highlight]"AutoPlay\\Docs\\Password test.pdf"[highlight]'[/highlight], "", SW_SHOWNORMAL, false);
    Any of these options should work just fine, if used with the data retrieved from the ListBox. Hope this helps.

    Ulrich

    Leave a comment:


  • Waldo
    replied
    Ulrich,
    I am still "working" on this getting this to work. Though I wish I knew more about the coding. One observation that I have made is that when I use the PDF example I posted in Post # 12 in this thread, I can get the file open in Sumtra though not using a listbox yet. But when I use any PDF that has a "space" in its file name, it errors out. Do you know if there is a requirement that the PDF file name must not contain any spaces when trying to open it from a listbox, etc. ? Thanks. JimC

    Leave a comment:


  • Waldo
    replied
    Kingzooly---No problem. I am still working on this but have not made it work yet. Hope your life gets better soon. Take care. Jimc

    Leave a comment:


  • kingzooly
    replied
    Originally posted by Waldo View Post
    Kingzooly---no rush. I am way for the weekend and won't have an opportunity to "learn" until late Monday afternoon. I do hope you feel better soon. JimC
    JimC I really sorry I not had time to get around to this, I really sorry about this I have not been around my partner had a crash well a fall on her bike and it put her off her leg I not had time to do any work on the computer with the code I used but if you wrapped the "\"Files Path Here\"" that should work.

    Leave a comment:


  • Waldo
    replied
    Kingzooly---no rush. I am way for the weekend and won't have an opportunity to "learn" until late Monday afternoon. I do hope you feel better soon. JimC

    Leave a comment:


  • kingzooly
    replied
    Originally posted by Waldo View Post
    Kingzooly, Thank you again for a reply. When you get "home" and have a spare moment or two---a demo would be greatly appreciated. No matter what I try, I cannot get a pdf with spaces in its name to open in Sumtra PDF using the Shell command in AutoPlay. Have safe travel home. JimC
    stuck in bed at the moment not well will try tonight for you.

    Leave a comment:


  • Waldo
    replied
    Kingzooly, Thank you again for a reply. When you get "home" and have a spare moment or two---a demo would be greatly appreciated. No matter what I try, I cannot get a pdf with spaces in its name to open in Sumtra PDF using the Shell command in AutoPlay. Have safe travel home. JimC

    Leave a comment:


  • kingzooly
    replied
    Yes then using the path in "" is needed for the commandline to know it needs to read white space, I had that very same problem on a tool I was using in AMS, I am no home right now so can't right a little demo.

    Leave a comment:


  • Waldo
    replied
    Kingzooly--thank you for the reply. When the filename has spaces, Sumtra PDF opens--but does not open the pdf file...it is just a though you opened Sumtra PDF directly without a PDF. If the PDF filename has no spaces, Sumtra PDF will open the PDF file (i.e. and the PDF file is password protected). I am still trying to get this to work using a listbox versus a button that is linked to a single PDF which is what I started with originally. Thank you. JimC

    Leave a comment:


  • kingzooly
    replied
    Originally posted by Waldo View Post
    Ulrich,
    I am still "working" on this getting this to work. Though I wish I knew more about the coding. One observation that I have made is that when I use the PDF example I posted in Post # 12 in this thread, I can get the file open in Sumtra though not using a listbox yet. But when I use any PDF that has a "space" in its file name, it errors out. Do you know if there is a requirement that the PDF file name must not contain any spaces when trying to open it from a listbox, etc. ? Thanks. JimC
    Dose it error our if you try and open that via lets say the computer its self or command line for that tool, if not then I don't think that is the problem there, but how you pass a string with white space sometimes as to be changed a little as I found out when I used a command line tool in the past


    local sDocumentname = ' "C:\\AA_AutoPlay_Practice\\Docs1\\Password_Test.pd f" ';
    local sArguments = sDocumentname;
    Shell.Execute("C:\\AA_AutoPlay_Practice\\Docs1\\Su matraPDF.exe", "open" , sArguments, "", SW_SHOWNORMAL, false);
    Making sure the file pasth is wrapped in "" if not white space will be seen as a brake in that part of the argument.

    Leave a comment:


  • Waldo
    replied
    Ulrich,
    I am still "working" on this getting this to work. Though I wish I knew more about the coding. One observation that I have made is that when I use the PDF example I posted in Post # 12 in this thread, I can get the file open in Sumtra though not using a listbox yet. But when I use any PDF that has a "space" in its file name, it errors out. Do you know if there is a requirement that the PDF file name must not contain any spaces when trying to open it from a listbox, etc. ? Thanks. JimC

    Leave a comment:


  • Waldo
    replied
    Use Sumtra PDF to open password protected PDFs from a listbox and not a button

    Ulrich,
    I am way in over my head; what I wondered is whether I can use the sumtra pdf viewer with a PDF password via a listbox and not as button as in this thread (link below to listbox thread). What I have been told to do is provide a listbox of PDF's that a user can select from (i.e. only one PDF selection permitted at a time)---but then open the PDF using the embedded Sumtra PDF. All of the PDF files available via the listbox would have a password assigned per this post.

    Link to listbox thread:
    http://www.indigorose.com/forums/thr...simple-Listbox

    In the settings tab on the listbox, I am using the "item data" column to populate information to open the PDF. I cannot discern how or where to insert code/scripting (i.e., I don't even know what code to insert) to have the user selected PDF in the listbox open using the embedded sumtra PDF by passing the password from the listbox to sumtra pdf.

    If this is too difficult or takes an unreasonable amount of your time, please let me know as I do not want to burden you, or anyone else in the forum, with my short comings. Thanks! JimC
    Last edited by Waldo; 04-11-2016, 01:56 PM. Reason: fix typos

    Leave a comment:

Working...
X