PDFQueueManagerNextInQueue Method Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Gets the next waiting item in the Pdf queue.
This method is new in CS 5.2

Namespace: ContentStudio.PDFServices
Assembly: CSServer5 (in CSServer5.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public string NextInQueue(
	ConnectionId connectionId,
	SessionId sessionId,
	string serverThreadIdentifier
)

Parameters

connectionId
Type: ContentStudioConnectionId
A value that identifies the web site
sessionId
Type: ContentStudio.SecuritySessionId
A value that identifies the user's session. This value usually originates from a call to OpenSession(ConnectionId).
serverThreadIdentifier
Type: SystemString
A value that the PDF server can use to identify its instance and thread. Content Studio uses this value when it logs information to its event log. This parameter can be null (Nothing in Visual Basic but its length cannot exceed MaxServerThreadIdentifierSize characters.

Return Value

Type: String

Xml.
If no item was found, the pdfitem element node will be missing.

Xml returned
<root>
    <status>0</status>
    <statustext>Success</statustext>
    <pdfitem>
        <queueentryid></queueentryid>
        <siteurls></siteurls>
        <documentid></documentid>
        <documentrevision></documentrevision>
        <documentname></documentname>
        <documentguid></documentguid>
        <destinationcategoryid></destinationcategoryid>
        <destinationdocumentid></destinationdocumentid>
        <entrydate></entrydate>
        <submitter></submitter>
        <optionsxml></optionsxml>
        <issynchronous></issynchronous>
        <synchronousdraftprefered></synchronousdraftprefered>
        <parsetree></parsetree>
        <querystrings></querystrings>
        <autoarchive></autoarchive>
        <flags></flags>
        <footerxml></footerxml>
    </pdfitem>
</root>

This xml has the following elements and meaning. If no data is found the root/pdfitem node and its children is missing

elementDescription
root/statusThe outcome of the call - always 0 (success)
root/statustextThe textual outcome of the call - always "Success"
root/pdfitemRepresents the returned item and its data nodes
root/pdfitem/queueentryidInteger: The identifier of the queued item.
root/pdfitem/siteurls

String: A semi colon separated list of url:s to the web site. Ex.
http://www.company.com/
or
http://www.company.com/;https://www.company.com/

The first member in the list is always the SiteURL setting which is required and considered as being the default url to use. If there are more url:s that can be used, these follow in the order in which they exist in the MultiHomedSiteURL setting. All values ends with a "/"

A PDF server uses this value to construct the address (url) to the documents to be converted to a PDF. It does so by constructing a url using the following template:
{0}default.aspx?id={1}&{2}

  • {0} - The site url to use. This is one of the members in the root/pdfitem/siteurls"/ return element.
  • {1} - This is the document identifier returned in the root/pdfitem/documentid"/ or if the document tree should be used; a member document in the tree.
  • {2} - Any additional query strings to use. This value is returned in the root/pdfitem/querystrings element.
root/pdfitem/documentid Integer: The document to use as source of the Pdf.
The PDF server process must have BROWSE permission to this document. If the document is the root of a tree of documents, PDF Server must have BROWSE permission to all of these documents.
root/pdfitem/documentrevisionInteger: The revison of the document's content to use.
root/pdfitem/documentnameString: The name of the document returned in the root/pdfitem/documentid element.
root/pdfitem/destinationcategoryidInteger: An identifier to the category where the generated Pdf should be uploaded to.
root/pdfitem/destinationdocumentidInteger: If there is an older version of the pdf to generate and this version should be replaced this value is the identifier of this document.
root/pdfitem/entrydateDateTime string value. A value that specifies when the found entry was submitted.
root/pdfitem/submitterString: A SID representing the user account that submitted this item.
root/pdfitem/optionsxmlString: An embedded xml document that specifies how the pdf should be rendered.
See below for a description of this xml.
root/pdfitem/issynchronousBit value (0 or 1), true (1) if the entry is synchronous; otherwise, false (0).
root/pdfitem/synchronousdraftpreferedBit value (0 or 1), valid for synchronous items only. When true (1) the Pdf server should use the draft version of the document rather than the approved. This makes it possibly to preview a pdf.
root/pdfitem/parsetreeBit value (0 or 1), when true(1); the Pdf server should traverse through the tree of documents and build combine all documents into one single Pdf document.
root/pdfitem/querystringsString: Additional query strings that the Pdf server should use when it browses the document to use as source.
root/pdfitem/autoarchiveBit value (0 or 1), indicates whether to archive older versions of this pdf.
root/pdfitem/flagsInteger flag value: One or more of the members in the PdfQueueFlags enumeration.
root/pdfitem/footerxmlString: An embedded xml document that contains the footer settings to use.
See below for a description of this xml.

Xml returned in the optionsxml element

optionsxml
<root>
    <author>No author</author>
    <keywords>keyword</keywords>
    <subject>No subject</subject>
    <papersize>9</papersize>
    <orientation>1</orientation>
    <printquality>4</printquality>
    <printresolution>300</printresolution>
    <resolution>300</resolution>
    <truetypeoption>2</truetypeoption>
    <scaling>100</scaling>
    <leftmargin>10</leftmargin>
    <rightmargin>10</rightmargin>
    <topmargin>10</topmargin>
    <bottommargin>10</bottommargin>
    <waitbeforeprint>2</waitbeforeprint>
    <domain>.</domain>
    <timeout>60</timeout>
    <printertimeout>120</printertimeout>
    <totaltimeout>60</totaltimeout>
    <colorimageflags />
    <colorimageresolution>600</colorimageresolution>
    <ieheader></ieheader>
    <iefooter></iefooter>
</root>

This xml has the following elements and meaning

elementDescription
root/authorString: The author of the document
root/keywordsString: A list of keywords to use
root/subjectString: The document title (subject)
root/papersize Integer: a value that specifies the paper size to use.
  • 1 - Letter, 8 1/2 x 11 in.
  • 2 - Letter Small, 8 1/2 x 11 in.
  • 3 - Tabloid, 11 x 17 in.
  • 4 - Ledger, 17 x 11 in.
  • 5 - Legal, 8 1/2 x 14 in.
  • 6 - Statement, 5 1/2 x 8 1/2 in.
  • 7 - Executive, 7 1/2 x 10 1/2 in.
  • 8 - A3, 297 x 420 mm
  • 9 - A4, 210 x 297 mm
  • 10 - A4 Small, 210 x 297 mm
  • 11 - A5, 148 x 210 mm
  • 12 - B4, 250 x 354 mm
  • 13 - B5, 182 x 257 mm
  • 14 - Folio, 8 1/2 x 13 in.
  • 15 - Quarto, 215 x 275 mm
  • 16 - 10 x 14 in.
  • 17 - 11 x 17 in.
  • 18 - Note, 8 1/2 x 11 in.
  • 19 - Envelope #9, 3 7/8 x 8 7/8 in.
  • 20 - Envelope #10, 4 1/8 x 9 1/2 in.
  • 21 - Envelope #11, 4 1/2 x 10 3/8 in.
  • 22 - Envelope #12, 4 1/2 x 11 in.
  • 23 - Envelope #14, 5 x 11 1/2 in.
  • 24 - C size sheet
  • 25 - D size sheet
  • 26 - E size sheet
  • 27 - Envelope DL, 110 x 220 mm
  • 28 - Envelope C3, 324 x 458 mm
  • 29 - Envelope C4, 229 x 324 mm
  • 30 - Envelope C5, 162 x 229 mm
  • 31 - Envelope C6, 114 x 162 mm
  • 32 - Envelope C65, 114 x 229 mm
  • 33 - Envelope B4, 250 x 353 mm
  • 34 - Envelope B5, 176 x 250 mm
  • 35 - Envelope B6, 176 x 125 mm
  • 36 - Envelope, 110 x 230 mm
  • 37 - Envelope Monarch, 3 7/8 x 7 1/2 in.
  • 38 - Envelope, 3 5/8 x 6 1/2 in.
  • 39 - U.S. Standard Fanfold, 14 7/8 x 11 in.
  • 40 - German Standard Fanfold, 8 1/2 x 12 in.
  • 41 - German Legal Fanfold, 8 1/2 x 13 in.
root/orientation Integer: The orientation of the page. Can be one of the values
  • 1 - Portrait
  • 2 - Landscape
root/printquality Integer: a value that indicates the quality requested. One of the following values.
  • 1 - Draft
  • 2 - Low
  • 3 - Normal
  • 4 - High
root/printresolutionInteger: A value (in dpi) that specifies the printer resolution.
root/resolutionInteger: A value (in dpi) that specifies the resolution.
root/truetypeoptionInteger: 2.
root/scalingInteger: a value (in percent) that specifies how the pdf is scaled.
root/leftmarginInteger: a value that specifies (in mm) the left margin of the generated Pdf.
root/rightmarginInteger: a value that specifies (in mm) the right margin of the generated Pdf.
root/topmarginInteger: a value that specifies (in mm) the top margin of the generated Pdf.
root/bottommarginInteger: a value that specifies (in mm) the bottom margin of the generated Pdf.
root/waitbeforeprintInteger: A value (in seconds) for the Pdf Server to wait before it starts printing the pdf.
root/domainString:
root/timeoutInteger: A value (in seconds) that specifies general time out value.
root/printertimeoutInteger: A value (in seconds) that specifies the pdf printer time out.
root/colorimageflagsInteger:
root/colorimageresolutionInteger: A value (in dpi) specifying the printer color resolution.
root/ieheaderString:
root/iefooterString:

Xml returned in the footerxml element

footerxml
<root>
    <usefooter>1</usefooter>
    <startfrompage>1</startfrompage>
    <startnumber>1</startnumber>
    <createcontext></createcontext>
    <includecontextinnumbering></includecontextinnumbering>
    <footertext>Page $currentpage of $totalpages</footertext>
    <footerleft>10</footerleft>
    <footertop>7</footertop>
    <footerwidth>100</footerwidth>
    <htmlfont_normal></htmlfont_normal>
    <htmlfont_bold></htmlfont_bold>
    <htmlfont_italic></htmlfont_italic>
</root>

this xml has the following elements and meaning

elementDescription
root/usefooterBit value (0 or 1), true (1) to include a page footer with each generated Pdf page; otherwise, false(0).
root/startfrompageInteger: The page to start numbering from. 1 is the very first page in the generated Pdf.
root/startnumberInteger: The value of the first page number to write.
root/createcontextBit value (0 or 1), true (1) if the Pdf server should create a context (index) page; otherwise, false
root/includecontextinnumberingBit value (0 or 1), true (1) to have the Pdf server to include context numbering.
root/footertext

String: The text to display as the footer.

Depending on the actual Pdf server implementation this text can contain markings that the Pdf server replaces with actual values ex. Page $currentpage of $totalpages might be replaced with the text Page 3 of 45 on page number 3 of a total of 45 pages.

It is up to the actual Pdf server implementation to define the actual markers to use.

root/footerleftInteger: the bottom margin (in mm) of the page footer.
root/footertopInteger: the top margin (in mm) of the page footer.
root/footerwidthInteger: the width (in mm) of the page footer.
root/htmlfont_normalString: The font to use for normal page footer text.
root/htmlfont_boldString: The font to use for bold page footer text.
root/htmlfont_italicString: The font to use for italic page footer text.
Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionThe value of the serverThreadIdentifier parameter is too long.
CSInvalidSessionExceptionThe session is invalid
CSPermissionDeniedExceptionThe caller has no permission to perform the requested action
XmlExceptionInvalid xml returned from the database.
SqlExceptionAn error occurred when executing the command against the Content Studio database
Content Studio permissions

The caller must have READ and WRITE permission on the PDF-queue in order to succeed.
Remarks

Note Note
This method is intended to be called by a Pdf server only.

A Pdf server uses this call when it queries the Pdf queue to get an item to be processed. If an item is returned the Pdf status queue flag is set to Processing and the item is locked for any other Pdf server threads.

See Also

Reference