I got some code below with the latest gdPicture.Net10 .
The code is not working as he's below, if u click button1, button2 and then button3 you will get the error "can not save file".
I then found after a while if u uncomment the code in button3 (first line) it works.
is there any explanation for this ?
as i feel a bit scary about it. I assume this is a bug ?
Code: Select all
private void button1_Click(object sender, EventArgs e)
{
gdViewer1.DisplayFromFile(@"D:\temp123.tif");
}
private void button2_Click(object sender, EventArgs e)
{
gdViewer1.GetAnnotationManager().AddRubberStampAnnot(ColorTranslator.FromHtml("#FF0000"), 0.5f, 0.5f, 0.5f, 0.5f, "TEST");
}
private void button3_Click(object sender, EventArgs e)
{
//gdViewer1.SaveDocumentToTIFF(@"d:\anyohterfile.TIF", TiffCompression.TiffCompressionCCITT3);
makePermanent();
if (gdViewer1.SaveDocumentToTIFF(@"d:\TEEEMP.TIF", TiffCompression.TiffCompressionCCITT3) != GdPictureStatus.OK)
{
throw new Exception("can not save file");
}
}
void makePermanent()
{
gdViewer1.DisplayFirstPage();
gdViewer1.BurnAnnotationsToPage(true);
for (int i = 1; i < gdViewer1.PageCount; i++)
{
gdViewer1.DisplayNextPage();
gdViewer1.BurnAnnotationsToPage(true);
}
}