Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. clicking a pdf button using c sharp

clicking a pdf button using c sharp

Scheduled Pinned Locked Moved C#
csharpjavascripthardwarequestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Wamuti
    wrote on last edited by
    #1

    First, sorry the subject title looks like an article name. ;P I have a pdf document and has a button embedded using javascript. Is there a possible way i can develop a C Sharp application to click the button? Not me to click it :-)

    Wamuti: Any man can be an island, but islands to need water around them! Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.

    G 1 Reply Last reply
    0
    • W Wamuti

      First, sorry the subject title looks like an article name. ;P I have a pdf document and has a button embedded using javascript. Is there a possible way i can develop a C Sharp application to click the button? Not me to click it :-)

      Wamuti: Any man can be an island, but islands to need water around them! Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.

      G Offline
      G Offline
      GlobX
      wrote on last edited by
      #2

      I would have a look around at C# PDF libraries like PDFSharp[^] and iTextSharp[^]. There are ones out there that will allow you to print PDF documents. Furthermore, I think trying to click the JavaScript-embedded button from C# is the wrong way to look at this - why would you try and run JavaScript inside a PDF that is open in memory in a C# application, especially when the JavaScript is probably dependent on Adobe Acrobat's particular implementation of JavaScript and its API? Why not just print it with your C# code? Do you get what I mean? I thought I would just add that to explain why I didn't tell you how to click the button. I'm not trying to shoot you down, just shed some light on my thought process :) EDIT: Brainwave! You probably don't even need a PDF library if all you're trying to do is print a PDF. Take a loot at the Adobe Reader's command line reference. Have a look at this post on Stack Overflow[^]. It shows two ways of printing with Adobe from the command line. In C# you can achieve this by using System.Diagnostics.Process[^] class. This link shows you examples of starting a process.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups