Click here to Skip to main content
15,885,086 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: unable to get property 'childnodes' of undefined or null reference Pin
jinzai17-Jul-14 12:26
jinzai17-Jul-14 12:26 
QuestionRewriting VB6 Point of Sale App in C# using Visual Studio 2013, .Net Framework 4.5.1 Pin
sgralnick3-Jun-14 10:41
sgralnick3-Jun-14 10:41 
AnswerRe: Rewriting VB6 Point of Sale App in C# using Visual Studio 2013, .Net Framework 4.5.1 Pin
CatchExAs19-Jun-14 12:28
professionalCatchExAs19-Jun-14 12:28 
AnswerRe: Rewriting VB6 Point of Sale App in C# using Visual Studio 2013, .Net Framework 4.5.1 Pin
Member 99087646-Aug-14 12:03
Member 99087646-Aug-14 12:03 
Question.Dat file Pin
jjanmendra1-Jun-14 22:03
jjanmendra1-Jun-14 22:03 
AnswerRe: .Dat file Pin
Richard MacCutchan1-Jun-14 22:57
mveRichard MacCutchan1-Jun-14 22:57 
AnswerRe: .Dat file Pin
Dave Kreskowiak2-Jun-14 2:28
mveDave Kreskowiak2-Jun-14 2:28 
QuestionActivex code to print pdf files on client machine Pin
Sachin Mehndiratta29-May-14 1:29
Sachin Mehndiratta29-May-14 1:29 
Hi All,

I am looking for expert advice on printing the pdf files at client machine.

I have created a sample project named ClientPrint as

XML
Imports System.Drawing
Imports System.Drawing.Printing
Imports System.Runtime.InteropServices

Namespace ActiveX
    Public Interface IActiveXPrintLib
        Sub PrintFile(filePath As String)
    End Interface

    <ProgId("ActiveX.PrintFile")>
   <ClassInterface(ClassInterfaceType.AutoDual)>
   <ComVisible(True)>
    Public Class ActiveXPrintLib
        Implements IActiveXPrintLib

        <ComVisible(True)>
        Public Sub PrintFile(filePath As String) Implements IActiveXPrintLib.PrintFile

            Dim AcroPdf As New AcroPDFLib.AcroPDF()
            AcroPdf.LoadFile(filePath)
            AcroPdf.printAll()
           
        End Sub

    End Class
End Namespace


I have created the dll and register the dll using regasm command on client machine.

Now at time of consuming the print method at client side using javascript as

<object id="myControl1" name="myControl1" classid="clsid:ActiveX.ActiveXPrintLib"> </object>

XML
var axComponent = new ActiveXObject("ActiveX.ActiveXPrintLib");
    alert(axComponent);
    if (axComponent == null) {
        alert('Probably not installed');
    }
    else {
        yourAxComponent.PrintFile('<%= Page.ResolveUrl("~/PdfTemp/0d818b57-9384-4f52-ae89-8ef5868064b7.pdf")  %>');
        alert('yes');
    }


I am getting the error that automation server can't create object, using IE I have enabled the active x and permisssions to download the activex. but it still gives me same error.

I am not sure whether my code is correct or not.

Any advice is really helpful.

Thanks in advance.
Sachin Mehndiratta
mehndi.sachin@gmail.com

AnswerRe: Activex code to print pdf files on client machine Pin
AmitGajjar29-May-14 6:43
professionalAmitGajjar29-May-14 6:43 
GeneralRe: Activex code to print pdf files on client machine Pin
Sachin Mehndiratta1-Jun-14 21:04
Sachin Mehndiratta1-Jun-14 21:04 
QuestionAttribute in .net Pin
Member 1079749328-May-14 21:30
Member 1079749328-May-14 21:30 
AnswerRe: Attribute in .net Pin
Pete O'Hanlon28-May-14 22:56
mvePete O'Hanlon28-May-14 22:56 
GeneralRe: Attribute in .net Pin
Manikandan1011-Jun-14 3:46
professionalManikandan1011-Jun-14 3:46 
GeneralRe: Attribute in .net Pin
AmitGajjar29-May-14 6:44
professionalAmitGajjar29-May-14 6:44 
Questionhow to change DataGrid specific column alignment to Center in C# programmatically Pin
ven75327-May-14 23:49
ven75327-May-14 23:49 
AnswerRe: how to change DataGrid specific column alignment to Center in C# programmatically Pin
Eddy Vluggen28-May-14 0:28
professionalEddy Vluggen28-May-14 0:28 
GeneralRe: how to change DataGrid specific column alignment to Center in C# programmatically Pin
ven75328-May-14 1:58
ven75328-May-14 1:58 
GeneralRe: how to change DataGrid specific column alignment to Center in C# programmatically Pin
Eddy Vluggen28-May-14 3:00
professionalEddy Vluggen28-May-14 3:00 
GeneralRe: how to change DataGrid specific column alignment to Center in C# programmatically Pin
ven75328-May-14 3:32
ven75328-May-14 3:32 
GeneralRe: how to change DataGrid specific column alignment to Center in C# programmatically Pin
Eddy Vluggen28-May-14 5:06
professionalEddy Vluggen28-May-14 5:06 
GeneralRe: how to change DataGrid specific column alignment to Center in C# programmatically Pin
ven75328-May-14 20:40
ven75328-May-14 20:40 
GeneralRe: how to change DataGrid specific column alignment to Center in C# programmatically Pin
Pete O'Hanlon28-May-14 20:50
mvePete O'Hanlon28-May-14 20:50 
GeneralRe: how to change DataGrid specific column alignment to Center in C# programmatically Pin
ven75329-May-14 0:11
ven75329-May-14 0:11 
GeneralRe: how to change DataGrid specific column alignment to Center in C# programmatically Pin
Pete O'Hanlon29-May-14 0:15
mvePete O'Hanlon29-May-14 0:15 
GeneralRe: how to change DataGrid specific column alignment to Center in C# programmatically Pin
ven75330-May-14 2:04
ven75330-May-14 2:04 

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.