I am working on ASP.NET Web Forms 4.5 using GDPictures 14 & DocuVieware component.
In my app I have added feature to Remove/Delete current Page. The Delete Curr Page is working fine with PDF & Image files (with more than 1 page) & Scanned docs page.
For docx & txt, for
Code: Select all
GetNativeImage()
In my javascript code :
Code: Select all
var params = { currentPage: currentPage };
DocuViewareAPI.PostCustomServerAction("docuView", true, "RemovePage", params);
Code: Select all
public static void HandleRemovePage(CustomActionEventArgs e)
{
RotateActionParameters rotateParams = JsonConvert.DeserializeObject<RotateActionParameters>(e.args.ToString());
int currPage = rotateParams.CurrentPage;
rotateParams = null;
// For PDF FILES
if (e.docuVieware.GetDocumentType() == DocumentType.DocumentTypePDF)
{
GdPicturePDF gdPdf = null;
if (e.docuVieware.GetNativePDF(out gdPdf) == GdPictureStatus.OK)
{
gdPdf.DeletePage(currPage);
e.message = GetMessage ("Page Deleted Successfully ", DocuViewareMessageIcon.Information);
}
}
// For Image Files, Scanned docs
int imgId;
if (e.docuVieware.GetNativeImage(out imgId) == GdPictureStatus.OK) // Doesn't get imgId for docx, txt files
{
GdPictureImaging gdImg = new GdPictureImaging();
if (gdImg.SelectPage(imgId, currPage) == GdPictureStatus.OK)
{
if ( gdImg.TiffDeletePage(imgId, currPage) == GdPictureStatus.OK)
//gdImg.ReleaseGdPictureImage(imgId) == GdPictureStatus.OK)
{
e.message = GetMessage("Document was rejected successfully.", DocuViewareMessageIcon.Information);
}
}
}
return;
}
Can you please help me with this !
Also, on calling CloseDocument() & Deleting a page, is it advisable to call gdImg.ReleaseGdPictureImage(imgId) ???
Thanks
Trupti