Solved

Lotus notes - pdf

Posted on 2001-06-26
22
632 Views
Last Modified: 2013-12-18
I have been designing Lotus notes database for lotus notes environment. In that database each document has tobe a link [pDF is not part of the database it is stored some where in the server harddrive] for corresponding PDF File. I have certain question.

1. How to create the link to the PDf File in the Lotus notes. So that user click on that link and PDf file gets open.
2. Is it possible to print that file directly from the lotus notes environment. Even if the user is accessing the database from his machine and pdf file has been located on the server?
3. Another requirement if user wants to replicate the database then he/she should be able to replicate the pdf files from the server to his own machine.

4. is it posssible to check whethere replica of current database is available on user machine

Please help me. It is urgent.

thanks,
Shrirang
0
Comment
Question by:shrihalbe
  • 16
  • 6
22 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6228450
One way is to include the pdf with database. Then you can replicate and keep the two dbs in Sync.

It is possible to check whether there is a replica copy of the same db. For that use OpenByReplicaID method

If your users are all located in same network (intranet) then you can use a script to load the pdf file with unc path.

For eg in postopen of the document use this api

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (Byval hwnd As
                     Long, Byval lpOperation As String, Byval lpFile As String, Byval lpParameters As String,
                     Byval lpDirectory As String, Byval nShowCmd As Long) As Long

                     Dim hwnd As Long 'the windows handle dont need to initalize
                     Dim lpOperation As String
                     Dim lpFile As String
                     Dim lpParameters As String
                     Dim lpDirectory As String
                     Dim nShowCmd As Long
                     Dim Hwin32 As Long 'the windows target handle dont need to initalize

                     'Initialize the vars
                     lpFile = "Filename.txt" 'Describe the file name
                     lpDirectory = "\\Server\Path" 'Describe file location
                     nShowCmd = 1 'Show the open file
                     lpOperation = "Open" 'if you want to print the file change to "Print"
                     'and finally execute the file
                     Hwin32 = ShellExecute(hwnd,lpOperation,lpFile,"",lpDirectory,nShowCmd)


~Hemanth



0
 

Author Comment

by:shrihalbe
ID: 6229357
Hello Hemanth,
  thanks very much
 i am really new in this area so can you explain it. i am not understanding properly. i am realy in mess. can you give your email id.

1. i don't want the pdf tobe a attachment to the document . i want pdf should be on the different location on the server.  and there should be some link in the document so user clicks on the link and PDF file gets open .

for this scenario do you have better solution
pleae let me know
0
 

Author Comment

by:shrihalbe
ID: 6229640
Hi Hemanth ,
  another thing i want to ask you. to call API what special things i have to do. otherwise is it possibe to call api in normal way. can you  give some more insight on API that would be great. what is UNC. where i can find all these information?

  can it be possible using that api i can replicate perticular PDF related to the  Local Machine of the user?

Thanks for Your Help

Shrirang
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6231428
For that Create two fields (ServerPath and File) and a button (Open associated PDF)

In the button have this script
===============================
Sub Click(Source As Button)
     Dim ws As New NotesUIWorkspace
     Dim note As NotesDocument
     
     Dim hwnd As Long 'the windows handle dont need to initalize
     Dim lpOperation As String
     Dim lpFile As String
     Dim lpParameters As String
     Dim lpDirectory As String
     Dim nShowCmd As Long
     Dim Hwin32 As Long 'the windows target handle dont need to initalize
     
     Set note =  ws.CurrentDocument.Document
     
     'Initialize the vars
     lpFile = note.File(0) 'file name
     lpDirectory = note.ServerPath(0) 'file location
     nShowCmd = 1 'Show the open file
     lpOperation = "Open" 'if you want to print the file change to "Print"
     'and finally execute the file
     If lpFile <> "" And lpDirectory <> "" Then
          Hwin32 = ShellExecute(hwnd,lpOperation,lpFile,"",lpDirectory,nShowCmd)
     End If
End Sub

In the global declarations of the form
=======================================
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (Byval hwnd As Long, Byval lpOperation As String, Byval lpFile As String, _
Byval lpParameters As String, Byval lpDirectory As String, Byval nShowCmd As Long) As Long

For running API you need Windows OS (as this script uses WIN32 API)

UNC - Universal Naming Convention ( what that means is that you can refer any server over network that is sharing directory with this format \\ServerName\Share)

Replication should not be a problem if you store exact server path and file name in a document, To access the server share the user should be on the network.

& this is my emailid: hemanthakumark@bigfoot.com

~Hemanth
0
 

Author Comment

by:shrihalbe
ID: 6231526
Thanks Hemanth,
  that will ease my job. another thing i want to ask . in unc \\server name  means is it a lotus server name or the nt server name. please let me know.
      another is there is any way to find the acrobat reader exe on the local machine . because for different user that might be in the different directory. if the acrobat reader is not installed on the machine is there any way i can use share acrobat reader copy of the network?
thanks,
shrirang
0
 

Author Comment

by:shrihalbe
ID: 6231585
ANOTHER THING I WANT TO ASK OPEN BYREPLICAID WILL OPEN THE DATBASE I DON'T WANT THAT DATABASE TOBE OPEN I WANT TO KNOW WHETHER THE SATBASE IS PRESENT OR NOT

THANKS,
SHRIRANG
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6231965
\\servername is the name of the NT Server not the domino.

OpenByReplicaID doesn't open the database it checks that if the db can be opened meaning if it exists then open the db in virtual space to access its methods and prop

eg:
Dim db As New NotesDatabase( "", "" )
If db.OpenByReplicaID( "Moscow", "85255FA900747B84" ) Then
  Print( db.Title & " was successfully opened" )
Else
  Print( "Unable to open database" )
End If

Use this updated script in your button.
======================================
Sub Click(Source As Button)
     Dim ws As New NotesUIWorkspace
     Dim note As NotesDocument
     
     Dim hwnd As Long 'the windows handle dont need to initalize
     Dim lpOperation As String
     Dim lpFile As String
     Dim lpParameters As String
     Dim lpDirectory As String
     Dim nShowCmd As Long
     Dim Hwin32 As Long 'the windows target handle dont need to initalize
     
     Set note =  ws.CurrentDocument.Document
     
     'Initialize the vars
     lpFile = note.File(0) 'Describe the file name
     lpDirectory = note.Path(0) 'Describe file location
     nShowCmd = 1 'Show the open file
     lpOperation = "Open" 'if you want to print the file change to "Print"
     'and finally execute the file
     If lpFile <> "" And lpDirectory <> "" Then
          Hwin32 = ShellExecute(hwnd,lpOperation,lpFile,lpParameters,lpDirectory,nShowCmd)
          Select Case Hwin32
          Case 2:
               Msgbox "File Not Found"
          Case 31:
               Msgbox "No helper application available"      ' Remove this later
               lpFile = "notepad.exe"
               lpParameters = note.File(0)
          End Select
          Hwin32 = ShellExecute(hwnd,lpOperation,lpFile,lpParameters,lpDirectory,nShowCmd)
     End If
End Sub

What it does ???

It checks for the file if it doesn't exist then it will prompt "File Not Found"

If there is no helper application then set the helper application and pass the file as parameter to the exe.

Hope this answers all of your questions
& 60 is little less ;-)

Cheers
~Hemanth
0
 

Author Comment

by:shrihalbe
ID: 6232122
Hello Hemanth,
 60 is less for that i will increase it. anothere thing i want to ask if the PDf file is on my local machine. right now there is no proper set up so that i will keep that macine on the local machine. but for testing how can i use the same API for that . please explain me.
Thanks,
shrirang
0
 

Author Comment

by:shrihalbe
ID: 6232172
Hello Hemanth,
 60 is less for that i will increase it. anothere thing i want to ask if the PDf file is on my local machine. right now there is no proper set up so that i will keep that macine on the local machine. but for testing how can i use the same API for that . please explain me.
Thanks,
shrirang
0
 

Author Comment

by:shrihalbe
ID: 6232227
Hi Hemanth ,
  really appreciated. thanks you very much. i tried same thing o my local macine i it was working fine. anothere thing i didin't understand the select statemet you have used. can you expain me little case 31.
  Another thing if the acrobat reader is not avilable on the local machine it is possible to share acrobat reader exe from share location.

thanks,
Shrirang
 

 

0
 

Author Comment

by:shrihalbe
ID: 6232498
Hello Hemanth,
 i tried the print option it is working fine but everytime it prints the 2 copies per page.

Thnaks,
shrirang
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:shrihalbe
ID: 6232769
Hello Hemanth ,
  is it possible to show only unread documents in the view?

Thanks,
shrirang

0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6232824
Showing unread doc only is not possible

Not sure why it would print 2 pages, unless you setup some copy preference to 2. Because the function doesn't handle number of copies. It is to do with the printer setup

code 31 indicates that there was no app associated with that file to open.

~Hemanth

0
 

Author Comment

by:shrihalbe
ID: 6233057
Hello Hemanth,
  i will check the printer setup. is there any way so that we can check the perticular file on the share drive using dir?
just i want to make sure i want to setup a Lotus notes server. is it necessary to have NT server installed on same machine? because i will keep these share PDF file some where in the network. does it matters to that functionality? please let me know.

Thanks,
shrirang
0
 

Author Comment

by:shrihalbe
ID: 6233235
Hello  Hemanth,
  i tried the print PDf function
  with following parameter it works fine
  ipdirectory  = "c:\shrirang"
  ipfile = "test.pdf

"but my machine name is mvapp136
 so i tried
ipdirectory  = "\\mvapp136\c:\shrirang"
  ipfile = \\mvapp136 \"test.pdf
but it doesn't work.

Please let me know.

we don't have server we have just network. does it matter to this ?

Thanks,
shrirang
0
 

Author Comment

by:shrihalbe
ID: 6233241
sorry i tried
 ipfile = "test.pdf" not "\\mvapp136\test.pdf

thanks,
shrirang
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6233257
For this you have to do one more thing you have to share the c:\shrirang as public share, right click on the directory that you want to share and give a name "ShareX" and ref like this

ipdirectory  = "\\mvapp136\ShareX"
ipfile = "test.pdf"


The file server can be anything , not necessarily a server where domino is running.


0
 

Author Comment

by:shrihalbe
ID: 6234846
Hello Hemanth,
i am using lotus notes designer . i don't have lotus server. i am developing some standalone application. i have two computers. we have network no server.
   Because of this i can not access the file that are on the other server.
   
   is there any special way i can test the network functionality.

  thanks,
shrirang
 
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 100 total points
ID: 6235205
Are you able to connect to the share through Windows Explorer ??

If you can then are you able to see the file ???

Check the user access rights for the share.

0
 

Author Comment

by:shrihalbe
ID: 6235682
Hello Boss,
    Thank you very much i was able to connect to network.
 Because of you i completed my functinality. Another thing i want to ask you is there any book , that will explains all the API ?

By the way where are you working ? you must be in USA ? am i right? if you don't mind could you give me ur Phone number. just i want to say thanks to you.

Thanks you very much.
Shrirang
 
0
 

Author Comment

by:shrihalbe
ID: 6235685
My Email ID shrihalbe@hotmail.com


Bye,
shrirang
0
 

Author Comment

by:shrihalbe
ID: 6238267
Thanks
 Shrirang
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now