HTML to Image Converter SDK Developer License (Royalty Free License)

灯泡 Homepage: http://www.verydoc.com/html-to-image.html

We have created a HTML to Image Converter SDK product today, the trial version will be released soon. The following are some C#, ASP.NET, VB.NET, C++, VB, etc. examples,

C# example,

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using System.Runtime.InteropServices;

 

namespace WindowsFormsApplication1

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

 

        [DllImport(@"pdfshell.dll", CharSet = CharSet.Auto)]

        static extern uint HtmlToImageSDKRunCmd([MarshalAs(UnmanagedType.LPStr)] string strCmdLine);

 

        private void button1_Click(object sender, EventArgs e)

        {

            string strCmd;

            strCmd = "-$=XXXXXXXXXXXXXX -url=http://www.verydoc.com -out=D:\\temp\\test.png";

            uint nRet = HtmlToImageSDKRunCmd(strCmd);

        }

    }

}

 

 

VC++ example,

 

#include <windows.h>

#include <stdio.h>

 

__declspec(dllexport)

int WINAPI HtmlToImageSDKRunCmd(const char *lpszCmdLine);

 

int main(int argc, char* argv[])

{

       if(argc == 1)

       {

              printf("Usage: [options] ...\n");

              return 0;

       }

       char szCmdBuf[2048] = {0};

       for(int i = 1; i < argc; i++)

       {

              strcat(szCmdBuf, "\"");

              strcat(szCmdBuf, argv[i]);

              strcat(szCmdBuf, "\" ");

       }

       int nRet = HtmlToImageSDKRunCmd(szCmdBuf);

       printf("nRet = %d\n",nRet);

       return nRet;

}

 

 

VB example,

 

Private Declare Function HtmlToImageSDKRunCmd Lib "pdfshell.dll" (ByVal strCommandLine As String) As Long

Private Sub Command1_Click()

 

    Dim nRet As Long

    Dim strCmd As String

   

    strCmd = "-$=XXXXXXXXXXXXXXXXXXXX"

    strCmd = strCmd & " -url=http://www.verydoc.com"

    strCmd = strCmd & " -out=D:\temp\test.png"

   

    nRet = HtmlToImageSDKRunCmd(strCmd)

    MsgBox (Str(nRet))

End Sub

 

 

-------------------------------------------------------------------

Customer questions:

-------------------------------------------------------------------

We are facing the below mentioned problem on server machine.

Unable to load DLL 'pdfshell.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

The above issue was simulated in our local system (localhost) too, to resolve it we have placed all the required .dll's in our 'System32' folder, also we have tried the same .dll's placed in root folder of the application and this too works fine.

But, when we apply the same method on the live server machine, we get this .dll not found error.

Please Help! 

-------------------------------------------------------------------

You need copy following DLL files to system32 folder,

GdiPlus.dll
html2image.dll
pdfshell.dll

if you are using 64bit system, you need copy above DLL files to C:\Windows\SysWOW64 folder.

if you are using 64bit system, you need also compile your C# code with x86 platform, because pdfshell.dll is a 32bit DLL library, it can only be called from 32bit EXE application.

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!