How to set a PDF to expire (Working Script)

Here is a little script I made up the other night. You can use it to allow a PDF to be opened only until a set date. I use this for when my employees go to service a customer. I want them to be able to see the customer's information, but only for 24 to 48 hours.<br /><br />CheckExpiration()<br /><br />function CheckExpiration()<br />{<br />/*-----START EDIT-----*/<br />var LastDay = 21<br />var LastMonth = 3<br />var LastYear = 2008<br />/*-----END EDIT-------*/<br /><br />/* DO NOT EDIT PAST HERE !!! */<br />var today = new Date();<br />var myDate=new Date();<br />LastMonth = LastMonth - 1<br />myDate.setFullYear(LastYear,LastMonth,LastDay);<br /><br />if (myDate<today)<br />  {<br />    this.closeDoc(1);<br />    app.alert("This files has expired.",1,0,"Expired");<br />  }<br />}

Here's a slightly different method, but it works..... (and, there is certainly no 'work around' for anyone to get data you don't want them to get!)
<br />
<br />It uses the Action on Open (sorry, I don't know the 'official' name of this - I'll describe it below..) in the pdf to send the user to a server checking mechanism (in this case, a date checker - but you could do the same thing with lots of stuff...)
<br />
<br />Here's how I set it up and it works great!
<br />
<br />1. Start a new document that you can get a form field into (don't use LiveDesign for this - that's too fancy... - just make a document in Word that says ______ then print to pdf to get a nice simple pdf that you can edit directly in Acrobat)
<br />
<br />2. Do a 'Run Form Field Recognition' and Acrobat will find the blank as a field.
<br />
<br />3. Edit this field to have a "key" name (my example, I will use "today" which tells me this is the day that my document starts).
<br />
<br />4. Under the 'Options' tab, make a Default Value of today's date (this will be the 'test against' date - for my example I'm showing how to expire a document in 30 days from creation date, but you could use anything you like - it is simple to modify!)
<br />
<br />5. From the 'Format' tab, use the Select format category of Date. Use a date format you like (my example uses mm/dd/yyyy) Note that this MUST match the server side code described later).
<br />
<br />6. For a 'live' document, you may want to go to the General tab and make the field Hidden as well as other things to not see the 'false' page, but that is outside the scope of this example.
<br />
<br />OK, now on to setting up the document to automatically send this info to your server for testing...
<br />
<br />1. Go to the 'Pages' view (click on the icon at the top left)
<br />2. right-click on the page, select Page Properties.
<br />3. Under the 'Actions' tab, select "Page Open" and "Submit a form" from the drop down boxes.
<br />4. Enter a URL to your web page (see below) that does the checking (like http://mytestdomain.com/Scripts/checkexpiredate.php so it is easy to remember)
<br />5. Check the HTML radio button.
<br />6. Check the 'Only these...' button and then 'Select fields'. Make sure your "key" field is checked as well as the 'Include Selected' button (sometimes, for me, these weren't - I don't know why, so check it!)
<br />
<br />Now, on to the server side...
<br />
<br />Here's the code that goes into the php server file;
<br />
<br /><?php<br />$day = date("d");<br />$month = date("m");<br />$year = date("Y");<br />$today = substr($_REQUEST["today"],3,2);<br />$tomonth = substr($_REQUEST["today"],0,2);<br />$toyear = substr($_REQUEST["today"],6,4);<br />  $tsp = mktime(0, 0, 0, $month, $day, $year);<br />  $tsd = mktime(0, 0, 0, $tomonth, $today, $toyear);<br />  $xdays = ($tsp - $tsd)/(24*60*60);  // as calculated from dates<br />$maxdays = 30; //set this to whatever your 'expire from today' date is<br />if ($xdays >= $maxdays)<br /> //do what you like to tell the user it is expired<br />else<br /> //show the info you want them to see<br />?>
<br />
<br />i (the info shown (or not) is outside the scope of this message, this is just a 'one way to make this work' example. In my system, I use a program called fpdf [http://fpdf.org] to create the pdf from 'scratch', building it to show the reader what I want them to see - whether it is a "Sorry, this is expired" document, or the data that they came for if the time hasn't expired.)
<br />
<br />THAT'S IT!!! It works great and you can use it to do tons of stuff - just set the "key" on the original document and make the server code check whatever it is you want!
<br />
<br />Pretty cool, I think! (and, it only took me, a novice programmer, about 3 hours to figure it all out!)
<br />
<br />Best of success with it - enjoy!

Similar Messages

  • How to set security type for lenovo working with hotspot?

    How to set wireless security type for lenovo laptop working with hotspot?
    Since I can connect with the other laptops except this brand.

    //add related mutip-part to combine parts
    MimeMultipart multipart = new MimeMultipart("related");
    //attach a pdf
    messageBodyPart = new MimeBodyPart();
    fds = new FileDataSource("h:/something.pdf");
    messageBodyPart.setDataHandler(new DataHandler(fds));
    messageBodyPart.setFileName(fds.getName());
    multipart.addBodyPart(messageBodyPart);
    //add multipart to the message
    message.setContent(multipart);
    //send message
    Transport.send(message);

  • How to attach a PDF document to work item .---urgent

    Hi EXperts ,
      I am wanted to know how to attach a PDF document to my work item which i will be geneating . Pls let me the Method coding to be done so that I can send the attachment also when the work item is generated ..
    What is need to pass to Workflow container ...
    Regards
    Abhilash

    Ah ok,
    then the only way I know is to get hold of some one with skills in Smart Forms, and alley up with them. Or better yet, use it as an excuse to learn to do it your self
    With a Smart Form, you can parse data into it, create the file, and then use the GOS functionality to attatch it to your BO. All this in back ground!
    Kind regards
    Mikkel

  • How to set tagged pdf settings for batch process

    Framemaker doesn't allow me to set tagged pdf settings without opening a file (i.e. *.mif/*.fm/*.book).We are using .MIF files to generate PDF in an automated process.( .MIF files will be sent to FrameMaker as a batch file using DZBATCHER then it it uses distiller to produce the PDF).
    How can I set tagged PDF settings for this kind of operation?

    Tagged PDF info is a document level property, i.e. you need to define it in the MIF. Check your MIF manual for: <DPDFStructure and <DPDFStructureDefined statements.
    Note: If you're using any FM version earlier that FM9 and not the FrameServer version, please read your EULA very carefully (Section 2.2 - 2.4) concerning automated creation of PDF files. With FM9, the restriction apparently has been loosened to only how the process is intiated (Section 2.3).
    Copies of the EULAs can be seen here: http://www.adobe.com/products/eulas/

  • How does set metric-type internal (bgp) work?

    i can't realise how the command "set metric-type internal " to work.
    bgp announce to ebgp use the igp next-hop metric as the med.
    the igp means only isis?
    does ospf use it ?
    will you tell me how to use it ? give me an example . thinks

    Hi,
    This command can be used into two different contexts:
    1- Redistribution into ISIS
    When you are redistributing routes into ISIS, you have the choice to set the metric-type as internal (between 0 and 64) or external (between 65 and 128)
    Internal metric are always prefer over external metric
    2- Set the MED to reflect IGP cost to the NH on eBGP updates
    You are receiving an iBGP update and before sending it to your eBGP peers, you want the MED for that prefix set to your IGP cost to the iBGP peer announcing this prefix.
    In this case the IGP can be anything.
    This command is not necessary if you are redistributing the route into BGP directly instead of receiving them from iBGP. In such case, the MED reflects by default the IGP cost of the redistributed prefix.
    HTH
    Laurent.

  • How to set default .PDF file extension for Form Downloads

    I am trying to find a way of setting the PDF file extension when I download forms.
    I author the forms under a Plus subscription and am then downloading the forms under a basic subscription Collaborator account (diffrent person)
    If I don't include .pdf as the file type when downloading a form with a unique name as the Collaborator, it downloads without a file extension.
    Remembering to continually add the pdf file extension is a pain so I'm hoping there is away of setting this as a defaulet for my 'collaborator' account ?

    Firstly, apologies for multiple posts, I received messages saying my comment hadn't posted and also checked my history before re-submitting.
    Okay, the process is
    1. Log in as the Author account and I can rename the file without having to set the extension
    2. Log in as the Collaboartor account - same PC, browser etc and it doesn't save with a default file extension; HOWEVER, I have done this whilst also being logged in on a diffrent browser as the Author
    3 I have just tried logging out as Author and only being in as the collaborator and the form downloaded with a default PDF.
    4. I had someone else log in as the collaborator from thei PC and browser whilst I was still signed inunder my author account and again they were unable to save as PDF by default
    This has me wondering if there is anything at play when you've got multiple Users?

  • How to set up PDF IFilter for SharePoint 2013?

    I want to set up PDF IFilter for SharePoint 2013. I know that this is possible for SharePoint 2010.
    http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=5542&fileID=5550
    http://www.adobe.com/devnet-docs/acrobatetk/tools/AdminGuide/Acrobat_Reader_IFilter_config uration.pdf

    Just wondering.. if you ever got this figured out? If not.. I can assist

  • How to get Adobe PDF converter to work?

    Bought this a few hours ago and it starts the process (have tried it on 2 different documents) and then I get an error message telling me it
    isn't working. HOW DO I GET THE SYSTEM TO WORK?
    Any suggestions?

    Good day Symmachus1,
    We had an account provisioning issue that may have affected you too during this time frame.  Are you able to access the service now? 
    We apologize for the inconvenience this has caused you.
    -David

  • How to read Spreadsheet, PDF and MS Work files

    I am new to BlackBerry world.  Is someone tell me how can I read MS Spreadsheet, Work and PDF from my BB8330?  Do I need buy or download any software or come with the BB?  Thanks
    Solved!
    Go to Solution.

    if your device has software 4.5.x.x you will automatically get documents to go which comes with 'word to go' and 'slideshow to go' if you open either of them, click menu button and select register, then after register you go to same menu and choose update now... this will update what you have and gove you 'sheets to go'
    as for PDF you have to buy the premium version or activate on a BES(through work)

  • How do I get PDF viewer to work?

    Since I downloaded FF 19,my PDF viewers (none of them,I downloaded Adobe,Foxit)DO NOT WORK.What can I do?I had Adobe on before and NEVER HAD ANY PROBLEMS,until FF decided to force their PDF viewer on us,which doesn't do the job.Ridiculous!!!

    Current Firefox versions have enabled a new build-in PDF Viewer and that viewer doesn't have all the features that the Adobe Reader has.
    You can change the action for Portable Document Format (PDF) from Preview in Firefox to use the Adobe Reader or set to Always Ask in "Firefox > Options > Applications".
    You can set the pdfjs.disabled pref to true on the <b>about:config</b> page to disable the build-in PDF viewer and use the Adobe Reader instead.
    See also:
    *https://support.mozilla.org/kb/view-pdf-files-firefox-without-downloading-them

  • How to set password complexity and expiration for ClearPass admin users

    Requirement:
    As a server admin, i wish to set complexity for my ClearPass admin (management login) password and also as per company policy wish to set password expiration. This document explains how it can be achieved.
    Solution:
    From ClearPass 6.5.0 a new Password Policy Settings form was added for both local users and admin users.
    Configuration:
    To use this option, go to either Administration > Users and Privileges > Admin Users > Password Policy or Configuration > Identity > Local Users > Password Policy. Options that can be configured for the password include length, complexity, disallowed characters, disallowed words, disallowed user ID or repeated characters, and the number of days to expiration.
    Admin User
    Local User
    Verification
    In Password Policy updated the password complexity as following (atleast one uppercase and one lowercase letter and 3 as disallowed character). Also set the Password expiration to 5 days.
    After that tried to reset the admin password with character 3 and got an error as following

    Please follow below steps:-
    This is available starting in RUP4.
    The script to expire all passwords in the fnd_user table is $FND_TOP/patch/115/sql/AFCPEXPIRE.sql.
    It can be executed from SQL*Plus or as a Concurrent Program: sqlplus -s APPS/ @AFCPEXPIRE.sql
    or Submit concurrent request: CP SQL*Plus Expire FND_USER Passwords
    This script sets the fnd_user.password_date to null for all users which causes all user passwords to expire.The user will need to create a new password upon the next login.
    Thanks,
    JD

  • How to set default PDF print locations to be same as source file

    Is it possible to make the "Save to" location for files created using the Adobe PDF print driver to be the same location as the source file?
    When I checked the prefs dialog box in the Adobe PDF print driver, the only setting I found was to make "PDF Output Folder" either the "My Documents" folder or "Prompt for PDF File Name." I wish there were a third option that said "Same as source file."
    -Danny

    Hi Daniel,<br /><br />Yes, it is possible to do so.<br /><br />Here is the solution:<br /><br />1) Open the PDF.<br />2) File->Print<br />3) Click the Properties button available on Print Dialog Box.<br />4) Select the Adobe PDF Settings Tab and you will find static text "Adobe PDF Output Folder", Go for "Browse" button available against that and select your preferred location.<br />5) Now the drop down menu will display all the options i.e. "My Documents" , "Prompt for PDF File Name" and "<Your selected Option>".<br /><br />I hope this will help resolve your issue.<br /><br />Thanks,<br />Atul Agarwal<br />Adobe Systems

  • Initial View set in PDF Document not working.

    I have a PDF document w/Initial View in the Document Properties set to Navigation tab: 'Bookmarks panel and Page', and Open to page '1''.  However, when I send this document out, the Initial View settings do not happen (The PDF opens to the page last accessed before the document was sent and the navigation pane does not display).  Help - what am I missing or doing wrong when trying to distribute PDF?
    I am using Acrobat X Pro.

    It might be the settings in Acrobat that is causing the problem. Edit – Preferences…, under Categories select Documents. Uncheck Restore last view settings when reopening documents.

  • How do I get pdf function to work?

    I downloaded trial of Adobe Acrobat XI, but when I try to make a pdf of an InDesign (CS3), it cannot "find" the printer.  Is there a fix for this?  I have Acrobat 8, but it does not want to work with my new Windows 8 computer.  Is there a patch or other fix for this issue?  Need it asap as I must deliver file to client today!

    Thanks folks.  I actually figured out the problem...I had to "install" an Adobe PDF printer.  Now it works fine.  As to Exporting, that works fine for regular files, but I need to print it in booklet form to be sent to a printer for printing.  It seems it will let you view it in spreads, but will not export as a booklet.  Thanks to all for your help!

  • How to set default pdf folder for Adobe 8.1.4

    Every time I want to open or save a file in Adobe I have to navigate through the computer to the folder I use for pdf files. Can I set a default folder somehow so Adobe always looks there first?
    Thanks,
    Richard

    > Can I set a default folder somehow so Adobe always looks there first?
    No.

Maybe you are looking for

  • Which platform I should use ?

    which java platform I should use to creat message display and settings in mobile phone ? and how can I add language code in java to show different laguage(other than English) on mobile screen ?

  • Help me please cant upload site :(

    Hey all, so im just trying to upload my friends website and we have all the details and as soon as we go to publish it gets about 60% way through then a message appears saying this folder path doesn't exist would you like to create this file path, i

  • ALV Drag&Drop - Action before Drop

    Hi experts, short question: I have 2 ALVs with an implemented Drag 'n' Drop behavior. Now I want to check BEFORE i drop the element if this element will fit to the Drop-target. (Example: my element has the length of 10, now I want to check if I have

  • Mulitple logon prompt not showing

    Hi all, We have 4 apps server include the CI. Normally during 2nd or more logon to the system, SAP will normally pop up a message saying something like "This user had currently loggon....." etc irreguless of whether multiple logon is allowed. In my C

  • Custom icons not showing in Google Maps

    I have saved to my public Dropbox folder some custom icons (this folder was recommended by the icon developer). The icons can be used and viewed on Google Maps when using IE but not using FF 8.0.