Click here to Skip to main content
15,889,266 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Import from SQL table by column Pin
Member 106666981-Jun-14 22:40
Member 106666981-Jun-14 22:40 
GeneralRe: Import from SQL table by column Pin
Member 106666981-Jun-14 22:59
Member 106666981-Jun-14 22:59 
GeneralRe: Import from SQL table by column Pin
Mycroft Holmes2-Jun-14 0:53
professionalMycroft Holmes2-Jun-14 0:53 
GeneralRe: Import from SQL table by column Pin
Member 106666982-Jun-14 4:49
Member 106666982-Jun-14 4:49 
GeneralRe: Import from SQL table by column Pin
Eddy Vluggen2-Jun-14 8:23
professionalEddy Vluggen2-Jun-14 8:23 
GeneralRe: Import from SQL table by column Pin
Member 106666982-Jun-14 20:42
Member 106666982-Jun-14 20:42 
QuestionIIf Statement - Different Problem With RDLC Pin
Paramu197329-May-14 15:05
Paramu197329-May-14 15:05 
QuestionActivex code to print pdf files on client machine Pin
Sachin Mehndiratta29-May-14 2:55
Sachin Mehndiratta29-May-14 2:55 
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

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>


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

QuestionClose a form at a specific moment Pin
dilkonika28-May-14 6:32
dilkonika28-May-14 6:32 
AnswerRe: Close a form at a specific moment Pin
Eddy Vluggen28-May-14 7:28
professionalEddy Vluggen28-May-14 7:28 
GeneralRe: Close a form at a specific moment Pin
dilkonika28-May-14 8:31
dilkonika28-May-14 8:31 
QuestionRe: Close a form at a specific moment Pin
Eddy Vluggen28-May-14 9:30
professionalEddy Vluggen28-May-14 9:30 
GeneralRe: Close a form at a specific moment Pin
Dave Kreskowiak28-May-14 13:33
mveDave Kreskowiak28-May-14 13:33 
GeneralRe: Close a form at a specific moment Pin
dilkonika29-May-14 6:14
dilkonika29-May-14 6:14 
GeneralRe: Close a form at a specific moment Pin
Dave Kreskowiak29-May-14 13:39
mveDave Kreskowiak29-May-14 13:39 
GeneralRe: Close a form at a specific moment Pin
Eddy Vluggen29-May-14 20:53
professionalEddy Vluggen29-May-14 20:53 
QuestionVBscript help - Copying files to a folder Name which changes for every user. Pin
Mohan Subramani28-May-14 1:14
Mohan Subramani28-May-14 1:14 
AnswerRe: VBscript help - Copying files to a folder Name which changes for every user. Pin
Dave Kreskowiak28-May-14 2:32
mveDave Kreskowiak28-May-14 2:32 
QuestionUsing IEnumerator in String arrays Pin
byka27-May-14 5:59
byka27-May-14 5:59 
AnswerRe: Using IEnumerator in String arrays Pin
Eddy Vluggen27-May-14 7:21
professionalEddy Vluggen27-May-14 7:21 
QuestionHow to Compare two Architectural element using Programming Languages Pin
FOAD AL-DHOH26-May-14 21:50
FOAD AL-DHOH26-May-14 21:50 
GeneralRe: How to Compare two Architectural element using Programming Languages Pin
Richard MacCutchan26-May-14 23:28
mveRichard MacCutchan26-May-14 23:28 
QuestionFilter nested entities Pin
dilkonika26-May-14 4:39
dilkonika26-May-14 4:39 
QuestionMake image jump up using vb6.0 Pin
Otekpo Emmanuel22-May-14 14:21
Otekpo Emmanuel22-May-14 14:21 
AnswerRe: Make image jump up using vb6.0 Pin
Eddy Vluggen23-May-14 7:34
professionalEddy Vluggen23-May-14 7:34 

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.