1

内部にコンテンツを持つフレックスコンポーネント、VBox があります。主にテキスト コンポーネント。

VBox は、PDF に保存できるようにしたいレポートを保持しています。これを実現するためにAlivePdfを使用していますが、生成された PDF を Adob​​e Reader (最新バージョン) で表示すると空白になります。

Notepad++ で PDF を開くと、確かにコンテンツがあり、ファイルが正しく構造化されていることがわかります。

これは私がPDFを生成するために使用している方法です:

private function doPrint(whatToPrint:UIComponent):void
{
    var printPDF:PDF = new PDF( Orientation.LANDSCAPE, Unit.MM, Size.A4 );
    printPDF.setDisplayMode( Display.FULL_PAGE, Layout.SINGLE_PAGE );
    printPDF.addPage();
    printPDF.addImage( whatToPrint, 0, 0, 0, 0, 'PNG', 100, 1, ResizeMode.FIT_TO_PAGE );

    // The string here looks to have produced a valid PDF but it doesn't render correctly
    var content:String = printPDF.save(Method.LOCAL);

    // Custom save file data in here, removed for clarity of issue
}
4

1 に答える 1

1

これを試して:

private function doPrint(whatToPrint:UIComponent):void
{
    var printPDF:PDF = new PDF( Orientation.LANDSCAPE, Unit.MM, Size.A4 );
    printPDF.setDisplayMode( Display.FULL_PAGE, Layout.SINGLE_PAGE );
    whatToPrint.validateNow();
    printPDF.addPage();
    printPDF.addImage( whatToPrint, 0, 0, 0, 0, 'PNG', 100, 1, ResizeMode.FIT_TO_PAGE );

    // The string here looks to have produced a valid PDF but it doesn't render correctly
    var content:String = printPDF.save(Method.LOCAL);

    // Custom save file data in here, removed for clarity of issue
}
于 2011-05-19T15:59:58.723 に答える