Home > Products > PDFcamp Printer


Functions in the Doc Converter COM Component

1.Properties 

html2PDF([in] BSTR pVal);

    Set input document filename or a URL point to a website, 
For Example,
    Doc2PDFCOM.html2PDF = "http://www.yahoo.com/";
    Doc2PDFCOM.html2PDF = "C:\test.doc";

htmlBuffer([in] BSTR pVal);

    You also can set input content from a buffer, this function only can work for a html stream,
please notice, you can't use "html2PDF" and "htmlBuffer" in one time,
For Example,
    Doc2PDFCOM.htmlBuffer = "<HTML><BODY>Hello</BODY></HTML>";

fileName([in] BSTR pVal);

    Set output pdf filename,
For Example,
    Doc2PDFCOM.fileName = "C:/html2pdf.pdf"

headersFooters([in] BSTR pVal);    

    Set "on" or "off" the page's header and footer when convert a html file to pdf file,
For Example,
    Doc2PDFCOM.headersFooters = "on";
    Doc2PDFCOM.headersFooters = "off";

htmlHeaders([in] BSTR pVal);

    Set page header in the pdf file, it only available when "headersFooters" equal "on",
For Example,
    Doc2PDFCOM.htmlHeaders = "Custom html header at here 1111111111";

htmlFooters([in] BSTR pVal);

    Set page footer in the pdf file, it only available when "headersFooters" equal "on",
For Example,
    Doc2PDFCOM.htmlFooters = "Custom html footer at here 2222222222";

paperType([in] long pVal);

    Set page type, the value is from 0 to 9,
    0 "Letter [8.5 x 11 in]",
    1 "Legal [8.5 x 14 in]",
    2 "Executive [7.25 x 10.5 in]",
    3 "Ledger [355.6 x 215.9 mm]",
    4 "Tabloid [11 x 17 in]",
    5 "Screen [10 x 7.5 in]",
    6 "A3 [297 x 420 mm]",
    7 "A4 [210 x 297 mm]",
    8 "A5 [148 x 210 mm]",
    9 Custom page size
For Example,
    Doc2PDFCOM.paperType = 7;

pageWidth([in] single pVal);

    Set page width, in pixel, it only available when the "paperType" equal 9,
For Example,
    Doc2PDFCOM.paperType = 9;
    Doc2PDFCOM.pageWidth = 300;
    Doc2PDFCOM.pageHeight= 300;

pageHeight([in] single pVal);

    Set page height, in pixel, it only available when the "paperType" equal 9,
For Example,
    Doc2PDFCOM.paperType = 9;
    Doc2PDFCOM.pageWidth = 300;
    Doc2PDFCOM.pageHeight= 300;

subject([in] BSTR pVal);

    If you wish mail the generated pdf file as an email's attachment, you may set the subject of this email,
For Example,
    Doc2PDFCOM.subject = "I can control the subject this way";
    Doc2PDFCOM.SendEmail();

body([in] BSTR pVal);

    If you wish mail the generated pdf file as an email's attachment, you may set the body of this email,
For Example,
    Doc2PDFCOM.body = "And I can control the body too"
    Doc2PDFCOM.SendEmail();

printerStatus([in] BSTR pVal);

    Control the "PDFcamp Printer" enable or disable status,
    "on" : Enable the "PDFcamp Printer", so the "PDFcamp Printer" is available for any printable applications,
    "off": Disable the "PDFcamp Printer", you only can create pdf file from this COM Component, the "PDFcamp Printer" is unavailable for any other applications,
For Example,
    Doc2PDFCOM.printerStatus = "on";
    Doc2PDFCOM.printerStatus = "off";

showStatusBar([in] BSTR pVal);

    Show or hide the printing process,
For Example,
    Doc2PDFCOM.showStatusBar = "on";
    Doc2PDFCOM.showStatusBar = "off";

getVersion([in] double pVal);

    Get the version number of this COM Component,
For Example,
    var version = Doc2PDFCOM.getVersion;

StillRunning([out, retval] long* pVal);

    This value retrieves the conversion status of the COM Component, if return value is 1, indicate the conversion is still running, 0 indicate the conversion is stoped,
For Example (VB codes),
    While PdfCreator.StillRunning = 1
        DoEvents
        Call WaitMessage
    Wend

2.Functions

    CreatePDF()

        Create PDF file,
    For Example,
        Set PdfCreator = New PDFOUTLib.PdfCreator
        PdfCreator.HTML2PDF = "C:\sample.html"
        PdfCreator.FileName = "C:\sample.pdf"
        PdfCreator.HeadersFooters = "off"
        PdfCreator.paperType = 6 '//7 is A4 paper, 6 is A3 paper
        PdfCreator.CreatePDF
        While PdfCreator.StillRunning = 1
            DoEvents
            Call WaitMessage
        Wend
        Set PdfCreator = Nothing
        Debug.Print "C:\sample.html -->C:\sample.pdf"

    ViewPDF()

        After create a PDF file and open it in Acrobat Reader software,
    For Example,
        Set PdfCreator = New PDFOUTLib.PdfCreator
        PdfCreator.HTML2PDF = "C:\sample.html"
        PdfCreator.FileName = "C:\sample.pdf"
        PdfCreator.HeadersFooters = "off"
        PdfCreator.paperType = 6 '//7 is A4 paper, 6 is A3 paper
        PdfCreator.ViewPDF
        While PdfCreator.StillRunning = 1
            DoEvents
            Call WaitMessage
        Wend
        Set PdfCreator = Nothing
        Debug.Print "C:\sample.html -->C:\sample.pdf"

    SendEmail()

        After create a PDF file and send it from your mail client,
    For Example,
        Set PdfCreator = New PDFOUTLib.PdfCreator
        PdfCreator.HTML2PDF = "C:\sample.html"
        PdfCreator.FileName = "C:\sample.pdf"
        PdfCreator.HeadersFooters = "off"
        PdfCreator.paperType = 6 '//7 is A4 paper, 6 is A3 paper
        PdfCreator.subject = "I can control the subject this way"
        PdfCreator.body = "And I can control the body too"
        PdfCreator.SendEmail
        While PdfCreator.StillRunning = 1
            DoEvents
            Call WaitMessage
        Wend
        Set PdfCreator = Nothing

3.Additional functions

    Word2PDF(BSTR m_pDocFile, BSTR m_pPDFFile);

    Another function which also can convert .doc, .xls, .html, .txt, .rtf etc files to PDF files, but it will popup a print dialog when conversion, this is a global function, you need set any value before you call it,
For example:
Private Sub Word2PDF_ShellPrint_Click()
    Set PdfCreator = New PDFOUTLib.PdfCreator
    PdfCreator.Word2PDF "C:\sample.doc", "C:\sample.doc.pdf"
    Debug.Print "C:\sample.doc -->C:\sample.doc.pdf"
    MsgBox "Word2PDF_ShellPrint finished"
    Set PdfCreator = Nothing
End Sub

4.Technology support
    support@verypdf.com
    http://support.verypdf.com/

    If you encounter any problems, please don't hesitate to contact us at support@verypdf.com, thank you.