PDFFile Property

Build 1501 on 14/Nov/2017  This topic last edited on: 1/Mar/2013, at 13:08

Description

Get/set the PDF output file name. Default is OutPDF.

Syntax

optprint.PDFFile = sFile

optprint

print options object created by Fred.GetPDFOptions("") or Ted.GetPDFOptions("")

Sfile

full path to the file name

Example

Dim optPrint As Editorial.PrintOptions = Nothing

optPrint = Fred.GetPDFOptions("")

optPrint.PDFFile = GetPdfName()

 

Public Shared Function GetPdfName() As String

    ' forms PDF name

    Dim Page As IPageDisp = FredApp.ActivePageDispatcher

    Dim lgEdDate As Integer = 4

    Dim oEdition = Page.GetEditionObj

    Dim strEditionName As String = oEdition.nameAttr

    Dim oPage As pageObj = EditorialLogin.Get().PageGet(Page.GetPageId)

 

    Dim strEditionDate As String = Left(Replace(CStr(oEdition.dateAttr.ToLocalTime()), "/", ""), lgEdDate)

    'Dim strSectionName As String = Fred.Sections.GetAtId(oPage.sectionRefAttr).extraStr

 

    Dim CentreCode As String = UCase(Mid(strEditionName, 1, 2))

    If Trim(CentreCode) = "" Or Trim(CentreCode) = "-" Then CentreCode = "xx"

 

    Dim ProductCode As String = UCase(Mid(strEditionName, 4, 3))

    If Trim(ProductCode) = "" Or Trim(ProductCode) = "-" Then ProductCode = "xxx"

 

    Dim sectionAttr As IGenericAttrObj = UtilsBase.GetAttributes(oPage.sectionRefAttr)

    Dim SectionCode As String = sectionAttr.GetString("extraStr")

    If Trim(SectionCode) = "" Or Trim(SectionCode) = "-" Then SectionCode = "Sx"

 

    Dim edNumAttr As IGenericAttrObj = UtilsBase.GetAttributes(oEdition.editionNumberRefAttr)

    Dim EditionCode As String = edNumAttr.GetString("extraStr")

    If Trim(EditionCode) = "" Or Trim(EditionCode) = "-" Then EditionCode = "Exx"

 

    Dim PageNumber As String = AddInUtils.sysPadLeadZero(CStr(Page.GetPageNumber), 3)

    Dim MMDD As String = Mid(strEditionDate, 3, 2) & Left(strEditionDate, 2)

    Dim colorChar As String = "C"

    If Not Page.TestColorPage Then colorChar = "M"

    ' S = Single Page,        D = Double Page x 1 digit, B = Broadsheet, Q = Quarter Fold, J = Jump Pages

    Dim PageType As String = "Y"

    If Not Page.TestTwoSides Then

      PageType = "S"

    Else

      PageType = "D"

    End If

    Select Case Page.GetPageHeight

      Case 1678712 : PageType = "B" ' Broadsheet: 590mm

      Case 796677 : PageType = "Q" ' Quarter Fold: 280mm

      Case 782451 : PageType = "Q" ' Quarter Fold: 275mm

      Case Else : PageType = "T" ' Tabloid: 375mm (1066987 millipoints)

    End Select

 

    Return "NN" & CentreCode & "-" & ProductCode & "-" & EditionCode & "-" & SectionCode & "-" & PageNumber & "-" & MMDD & "-" & colorChar & PageType & ""

  End Function

See also

XMLFile Property