[scribus-dev] PDF output

Craig Bradney cbradney at scribus.info
Mon Aug 22 22:33:13 UTC 2011


On 8/22/11 9:23 PM, Elvis Stansvik wrote:
> 2011/8/22 Elvis Stansvik <elvstone at gmail.com>:
>> Hey folks,
>>
>> So, for the first time I took a closer look at what's involved in
>> getting PDF output of an item.
>>
>> Somehow I had imagined that there would actually be some form of
>> painter API available for it. But it seems that you actually have to
>> manually append PS/PDF commands to a string in
>> PDFLibCore::PDF_ProcessItem(...) :(
>>
>> Is this correct?
>>
>> This seems extremely fragile to me, and I've never worked with the PS
>> language directly before. I see that the PDFLibCore has at least some
>> convenience functions that might help me with the generation.
>>
>> If I haven't missed anything and this really is the way to do it, then
>> I guess the best/easiest way forward is to:
>>
>> 1) Make the existing CollapsedTablePainter (which handles painting of
>> a table to canvas, e.g. painting to an ScPainter) a friend of
>> PDFLibCore, to be able to access its convenience functions.
>>
>> 2) Add something like a
>>
>> CollapsedTablePainter::paintTablePDF(PageItem_Table* table, PDFLibCore
>> *pdf, QString& output)
>>
>> function that will append the PDF commands to the output parameter,
>> and which will use convenience functions of PDFLibCore where
>> appropriate.
>>
>> 3) Have PDFLibCore keep an instance of CollapsedTablePainter and have
>> it call paintTablePDF(...) in PDF_ProcessItem(...) when encountering a
>> table item. This is analog to how the PageItem_Table itself currently
>> has an instance of CollapsedTablePainter and calls the paintTable(...)
>> function in DrawObj_Item(...) to paint the table on canvas. A lot of
>> code in CollapsedTablePainter can then hopefully be reused.
> 
> The paintTablePDF(...) would of course also call the
> PDFLibCore::PDF_ProcessItem(...) for processing the text frames of its
> cells.
> 
> Elvis

Jean, can you please jump in here for Elvis and provide some advice?

thanks
Craig



More information about the scribus-dev mailing list