incubator-ooo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jianlizhao <jianlizh...@hotmail.com>
Subject a question of Export custom file format?
Date Wed, 06 Jun 2012 15:37:20 GMT
Hi  蜗牛

You can modify the source code to be recompiled.


Reference< XRenderable > xRenderable( mxSrcDoc, UNO_QUERY )
VCLXDevice*                 pXDevice = new VCLXDevice;
......
PDFWriter*  pPDFWriter = new PDFWriter(
aURL.GetMainURL(INetURLObject::DECODE_TO_IURI), PDFWriter::PDF_1_4,
eCompressMode );
OutputDevice*  pOut = pPDFWriter->GetReferenceDevice();
pXDevice->SetOutputDevice( pOut );
......
GDIMetaFile	aMtf;
const MapMode   aMapMode( MAP_100TH_MM );
const Size      aMtfSize( aPageSize.Width, aPageSize.Height );

pOut->Push();
pOut->EnableOutput( FALSE );
pOut->SetMapMode( aMapMode );

aMtf.SetPrefSize( aMtfSize );
aMtf.SetPrefMapMode( aMapMode );
aMtf.Record( pOut );

xRenderable->render( nSel - 1, aSelection, aRenderOptions );
aMtf.Stop();
aMtf.WindStart();

if( aMtf.GetActionCount() )
    bRet = ImplExportPage( *pPDFWriter, aMtf, nCompressMode ) || bRet;

pOut->Pop();
Regards


Mime
View raw message