tangs7 / alivepdf

Automatically exported from code.google.com/p/alivepdf
0 stars 0 forks source link

Adding the same display object twice #215

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a PDF object, addPage, then add a display object using addImage.
2. Modify the display object
3. Execute addPage on the display object and addImage for the modified 
object.

What is the expected output? What do you see instead?
I would like to get a two page pdf file with the original content on page 
one and the modified content on page two.  However, when I open the pdf 
file, I get the same image on both page one and page two.

What version of the product are you using? On what operating system?
Version 0.1.5 RC in Flex Builder on Windows 7 x64

Please provide any additional information below.
The code used to generate both files is very similar except that one adds 
pages to the Alive PDF object and one adds Pages to the FlexPrintJob 
object:

private function AddReport(report:UIComponent, target:Object):void {
  if ( target is PDF ) {
    PDF(target).addPage();
    PDF(target).addImage(report, new Resize(Mode.FIT_TO_PAGE, 
Position.CENTERED));
  } else if ( target is FlexPrintJob ) {
    FlexPrintJob(target).addObject(report, FlexPrintJobScaleType.SHOW_ALL);
  }
}

Original issue reported on code.google.com by raj...@gmail.com on 30 Mar 2010 at 8:18

Attachments:

GoogleCodeExporter commented 9 years ago
I just tested and confirmed that if I generate a 5 page report to both the 
FlexPrintJob 
and the AlivePDF, I get the correct 5 pages at the print job and the alivePDF 
saves 5 
pages of the last image that was added.

Original comment by raj...@gmail.com on 30 Mar 2010 at 8:37

GoogleCodeExporter commented 9 years ago
This is by design. AlivePDF caches the DisplayObject to reduce the size of the 
PDF & 
speed up processing. If you want 5 different images, use 5 different 
DisplayObjects.

Or you could modify addImage and add an extra parameter like 
skipCache:Boolean=false, 
and modify the logic to not use the cached displayObjects when it is set to 
true.

Original comment by dro...@gmail.com on 12 May 2010 at 1:49

GoogleCodeExporter commented 9 years ago
I'm also trying to do the same thing by using addImage to take multiple 
snapshots of the same ESRI map object (DisplayObject) to store data in a PDF.

Using multiple map objects to do this is not practical.

Original comment by GMWat...@googlemail.com on 8 Mar 2011 at 3:29