• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. opening pdf file with okular

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 144
  • Views 8921
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

opening pdf file with okular

Drake96
Drake96 over 3 years ago

Hola,

am using below code -

path = /x/y/z

Dir = strcat(path "/word")
user = strcat( Dir "/" "Manual.pdf")

hiCreateMenuItem(
?name 'MenuItem
?itemText "A"
?callback strcat("okular " user " &")
)

am trying to open the manual.pdf , when i click " A"

am getting error as *Error* strcat: argument #1 should be either a string or a symbol (type template = "S") - nil
*Error* lineread/read: syntax error encountered in input
<<< Stack Trace >>>
_closePortOnError = t
_insideilparser = t

i have tried that -

hiCreateMenuItem(
?name 'MenuItem
?itemText "A"
?callback "ipcBeginProcess(\"okular " user "\")"
)

not working :(

Drake

  • Cancel
  • AurelBuche
    AurelBuche over 3 years ago

    Hi Drake,

    This is normal as you have a syntax error in your code:

    path = /x/y/z

    is no valid skill code

    also your ipcBeginProces code lacks an strcat to work properly

    You don't need ipcBeginProcess (even if it will work), you can simply use a system call if you run it as a background job (with &)
    (system "okular ... &") should do the job

    I could help you write your code but I will need more details about what you want to do
    I guess user is a fixed path to a user manual ? or can it change ?

    Also I would advise you to use a naming convention of your variables less prone to errors but this is strictly personal

    I'd use pdf instead of user for instance (I believe you mean user manual but it's confusing)

    I'd also use lowercase for Dir

    Cheers

    Aurel

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • AurelBuche
    AurelBuche over 3 years ago in reply to AurelBuche

    I would do something like this:

    (inScheme

     (letseq ((path "/x/y/z")
              (dir  (strcat path "/word"))
              (pdf  (strcat dir "/" "Manual.pdf"))
              )

       (defun open_in_okular (path "t")
         "Properly open file at PATH using okular"
         ;; Check path
         (assert (isReadable path) "Unable to read file at %A" path)
         ;; Run okular in background
         (system (lsprintf "okular %s &" path))
         )

       (defglobalfun open_user_manual_using_okular (@rest _args)
         "Open user manual using okular"
         (open_in_okular pdf))

       ));Scheme closure


    hiCreateMenuItem(
    ?name 'MenuItem
    ?itemText "A"
    ?callback "(open_user_manual_using_okular)"
    )


    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • saurabh96
    saurabh96 over 3 years ago

    you can try this way-

    path = /x/y/z

    Dir = strcat(path "/word")
    user = strcat("okular"  Dir "/" "Manual.pdf" " &")

    hiCreateMenuItem(
    ?name 'MenuItem
    ?itemText "A"
    ?callback "ipcBeginProcess(user)"
    )

    Hope it hepls!


    Also @Aural sol is helpful!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information