PdfGenerate Method

Build 1501 on 14/Nov/2017  This topic last edited on: 22/Mar/2016, at 17:07

Description

Generates PDF directly from an article and returns the error code.

Syntax

errorcode = object.PDFGenerate(opt, checksize, currentText)

object

Required. Object name. Returned by Ted.GetActiveArticle or by Fred.GetActiveArticle.

opt

Required. Object name, returned by GetPDFOptions.

checksize

Required. True to check size.

currentText

Required. True to print the current text and not the entire article.

Remarks

Return values are:

errCanNotLoadOpt  =1 (PDF options are not loaded)

errNoDocToPrint   =2 (no document to print)

errNoOutput       =3 (XML file and/or printer are defined as empty)

errSendOutput     =4 (XML is generated, but it's not possible to send it to printer)

errInvalidPrintOpt=5 (boundingbox/mediabox parameters are wrong, in Ted)

Remarks

Code in FRED4UTILS.VB

  Public Shared Sub PDFGenerate(ByVal fredApp As IFredApp)

    Dim opt = fredApp.GetPDFOptions("")

    If Not opt Is Nothing Then

      Dim res As Short

      If opt.ShowDlg(0, 0, fredApp.GetQualifier = 1) Then

        'opt.File = "c:\temp\print\fred.xml"

        res = fredApp.PDFGenerate(opt, true, false)

        If res > 0 Then

          MsgBox("PDF Error: " & res)

        End If

      End If

    End If

  End Sub

Context

Article object