Click here to Skip to main content
15,902,492 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to set an environmet variable in C# ? Pin
Lutosław10-Oct-07 21:59
Lutosław10-Oct-07 21:59 
GeneralRe: How to set an environmet variable in C# ? Pin
s v joshi10-Oct-07 23:55
s v joshi10-Oct-07 23:55 
GeneralRe: How to set an environmet variable in C# ? Pin
Scott Dorman11-Oct-07 4:13
professionalScott Dorman11-Oct-07 4:13 
GeneralRe: How to set an environmet variable in C# ? Pin
s v joshi12-Oct-07 2:45
s v joshi12-Oct-07 2:45 
GeneralRe: How to set an environmet variable in C# ? Pin
Scott Dorman12-Oct-07 2:52
professionalScott Dorman12-Oct-07 2:52 
GeneralRe: How to set an environmet variable in C# ? Pin
Dave Kreskowiak11-Oct-07 4:23
mveDave Kreskowiak11-Oct-07 4:23 
GeneralRe: How to set an environmet variable in C# ? Pin
s v joshi12-Oct-07 3:25
s v joshi12-Oct-07 3:25 
QuestionAlright, I need help with GetJSObject() Pin
shea85110-Oct-07 21:11
shea85110-Oct-07 21:11 
Ok, here is some code (i cut some out so this message would not be too long) that I found that is for VB.NET for converting a PDF to a TIFF image.(it's at the very bottom, and how the heck do you do code(or even quote?) boxes on these forums???)

I'm trying to convert this code to C#. I've looked over the Acrobat Javascript API documentation and found that if I change "com.adobe.acrobat.tiff" to "com.adobe.acrobat.html-3-20" it will save as HTML, rather than TIFF. (which is my goal)

So, i've got Visual Studio Express for C# going and i've loaded my Acrobat reference, but i'm stuck on the javascript bridge part. For some reason Adobe thought it would be awesome to make a "Save As.." function only available with Javascript, so to do it on .NET one must create a javascript bridge.

What can I do to make this javascript bridge work?? here is the code I have so far for C#.. see the comment
I have searched and searched but found no "reference" for "JSObj". Can anyone provide any help at all with this?
C#
My C# code..

CAcroPDDoc pdDoc;
CAcroAVDoc avDoc;
string test = @"C:\temp\test.htm";
pdDoc  = (CAcroPDDoc)avDoc.GetPDDoc();
object JSObj = pdDoc.GetJSObject();
JSObj.SaveAs(test, "com.adobe.acrobat.html-3-20"); //this part it doesn't like.. JSObj has no options like "saveas" like it's supposed to



VB
VB Code I found..

' Create Acrobat Application object 
        PDFApp = CreateObject("AcroExch.App") 
        ' Create Acrobat Document object 
        PDDoc = CreateObject("AcroExch.PDDoc") 

' Open PDF file 
        PDDoc.Open(Me.txtPDFPath.Text) 
        ' Create AV doc from PDDoc object 
        AVDoc = PDDoc.OpenAVDoc("TempPDF") 

' Hide Acrobat application so everything is done in silent mode 
        PDFApp.Hide() 

' Create Javascript bridge object 
        JSObj = PDDoc.GetJSObject() 

' Test making change to one of the text fields 
        ' Syntax for GetField method GetField( strFieldName ) 
        JSObj.GetField("Text2.0.0.0.0").value = "JESSICA" 

' Test pulling data from a PDF text field and showing in a Windows Messagebox 
        strPDFText = JSObj.GetField("Text2.0.0.2.0").value 

' Attempt to save PDF to TIF image file. 
        ' SaveAs method syntax .SaveAs( strFilePath, cConvID ) 
        ' For TIFF output the correct cConvid is "com.adobe.acrobat.tiff" 
        ' cCovid MUST BE ALL LOWERCASE and path cannot be a system or root folder. 
        JSObj.SaveAs("C:\TestTiffs\TestGood.tif", "com.adobe.acrobat.tiff") 


-Shea


-- modified at 6:27 Thursday 11th October, 2007
AnswerRe: Alright, I need help with "GetJSObject()"; Pin
Anthony Mushrow10-Oct-07 21:24
professionalAnthony Mushrow10-Oct-07 21:24 
AnswerRe: Alright, I need help with GetJSObject() Pin
wizardzz10-Apr-12 9:24
wizardzz10-Apr-12 9:24 
QuestionQuestion about active directory Pin
Robert Wang198310-Oct-07 21:10
Robert Wang198310-Oct-07 21:10 
QuestionThe value DataGridViewRow.Tag is lost after sorting Pin
Michael Sync10-Oct-07 21:01
Michael Sync10-Oct-07 21:01 
AnswerRe: The value DataGridViewRow.Tag is lost after sorting Pin
TJoe11-Oct-07 3:07
TJoe11-Oct-07 3:07 
QuestionToolStripMenuItem with ContextMenuStrip Pin
User 269896710-Oct-07 21:00
User 269896710-Oct-07 21:00 
AnswerRe: ToolStripMenuItem with ContextMenuStrip Pin
half-life10-Oct-07 21:21
half-life10-Oct-07 21:21 
GeneralRe: ToolStripMenuItem with ContextMenuStrip Pin
User 269896710-Oct-07 21:49
User 269896710-Oct-07 21:49 
GeneralRe: ToolStripMenuItem with ContextMenuStrip Pin
half-life10-Oct-07 21:53
half-life10-Oct-07 21:53 
GeneralRe: ToolStripMenuItem with ContextMenuStrip Pin
User 269896710-Oct-07 22:01
User 269896710-Oct-07 22:01 
GeneralRe: ToolStripMenuItem with ContextMenuStrip Pin
half-life10-Oct-07 22:07
half-life10-Oct-07 22:07 
QuestionThreads Pin
half-life10-Oct-07 20:56
half-life10-Oct-07 20:56 
AnswerRe: Threads Pin
Anthony Mushrow10-Oct-07 21:17
professionalAnthony Mushrow10-Oct-07 21:17 
GeneralRe: Threads Pin
half-life10-Oct-07 21:23
half-life10-Oct-07 21:23 
QuestionRegarding DIV Pin
Satish_S10-Oct-07 20:48
Satish_S10-Oct-07 20:48 
QuestionLoading data to SQL Server from .csv file Pin
Aswini Kumar10-Oct-07 20:29
Aswini Kumar10-Oct-07 20:29 
AnswerRe: Loading data to SQL Server from .csv file Pin
Rob Philpott10-Oct-07 22:22
Rob Philpott10-Oct-07 22:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.