Hi,
printing one by one images in a multipage TIFF results in an incorrect PDF. When trying to open the PDF, Acrobat Reader complains about "Wrong operand type".
The equivalent VB code works just fine and generates a correct PDF.
C++ code provide bellow.
Thanks,
Spurlos
#import "C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Mscorlib.tlb"
#import "DynamicPDF.tlb" inject_statement("using namespace mscorlib;")
DynamicPDF::IDocumentPtr doc;
doc.CreateInstance( __uuidof(DynamicPDF::Document));
//Create Document object and set properties
doc->PutCreator( _T( "DynamicPDF"));
doc->PutAuthor( _T( "Spurlos"));
doc->PutAuthor( _T( "Test"));
// margins
doc->PutDefaultMarginLeft( 15);
doc->PutDefaultMarginRight( 15);
doc->PutDefaultMarginTop( 25);
doc->PutDefaultMarginBottom( 25);
DynamicPDF::ITiffFilePtr tiffFile;
tiffFile.CreateInstance( __uuidof(DynamicPDF::TiffFile));
tiffFile->LoadTiff( tif);
for( int i = 0; i < tiffFile->GetImageCount(); ++i)
{
DynamicPDF::IImageDataPtr img = tiffFile->GetImage( i);
DynamicPDF::IPagePtr page = doc->AddPage();
page->AddImage( img.GetInterfacePtr(), 0, 0, 0);
}
// this also works fine but I need the one by one fine grain control
// doc->AppendTiffFile( tif , 1, -1);
// draw the PDF
doc->DrawToFile( pdf);
Multipage TIFF in C++
Re: Multipage TIFF in C++
Support · Mar 9, 2006Can you send over the tiff image you are tesintg in this case? Please send this multipage tiff to [^a|mailto:support@cete.com|Support^]. We can then try and duplicate this behavior.
Thanks,
ceTe Software Support Team
Re: Multipage TIFF in C++
Forum member · Mar 9, 2006Hi,
Thanks for the prompt answer. Source TIF and generated PDF file have been e-mailed.
/Spurlos
Re: Multipage TIFF in C++
Forum member · Mar 11, 2006Hi Support,
my bad. :) I was using 0 for ImageScale. Anyway, thanks for the prompt support.
/Spurlos