Something isn't working here. Using the code below the title of the pdf should
be property "theSubject". But the title is empty. Trying to set the title with
PDFDocumentMBS also doesn't work. Setting the author works. Using RB2011r2,
Lion, Cocoa.
Private Sub CreatePDF(theSubject as String, thePDFFile as FolderItem,
PathPrinted as FolderItem)
'add to the raw printed html page numbers and the subject as header
if PathPrinted = nil then Return
'get page count
if thePDFFile = nil then Return
dim thePDFDoc as CGPDFDocumentMBS
thePDFDoc = thePDFFile.OpenAsCGPDFDocumentMBS
if thePDFDoc = nil then Return
dim pageCount as Integer = thePDFDoc.PageCount
'make new pdf
dim finalPDF as CGContextMBS
finalPDF = PathPrinted.NewCGPDFDocumentMBS(thePDFDoc.MediaBox(1), theSubject,
SystemInformationMBS.UserName, "Mail Archiver X")
'loop through pages and add header information
for currentPage as Integer = 1 to pageCount
dim theRect as new CGRectMBS
theRect = thePDFDoc.MediaBox(currentPage)
if theRect = nil then Return
finalPDF.BeginPage theRect
finalPDF.DrawCGPDFDocument(thePDFDoc, theRect, currentPage)
DrawPDFHeader(finalPDF, theSubject, 50, theRect.Height - 35), false
DrawPDFHeader(finalPDF, str(currentPage) + "/" + str(pageCount),
theRect.Width - 50, theRect.Height - 35), true
'page is finished
finalPDF.EndPage
next
finalPDF.Flush
end sub
Begin forwarded message:
> From: Beatrix Willius <[email protected]>
> Subject: Setting meta data of pdf
> Date: 3. Oktober 2011 14:15:40 MESZ
> To: MBS Real Studio Plugin List <[email protected]>
>
> Hi,
>
> I have seen that the constructor CGNewPDFDocumentMBS has lots of options to
> set meta data for a new pdf. But what about existing pdfs? I'm creating my
> pdfs with html printing and want to set title and suggested name when using
> "Save as pdf".
Mit freundlichen Grüßen/Regards
Trixi Willius
http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info