Print and Save Question

Discussions about DocuVieware integration in GdPicture.NET.
Post Reply
PerryB
Posts: 2
Joined: Tue Oct 22, 2019 2:04 pm

Print and Save Question

Post by PerryB » Wed Oct 23, 2019 2:39 pm

We're developing a web application using ASP.NET Web Forms that involves some document processing and everything seems to be progressing well. The appliation allows the user to load a document (multipage tiff) and do some standard editing on the file like page rotation, page flip, page delete and redaction. To handle these edit actions we have our own buttons and use the PostCustomServerAction method to call our own methods to do the work.

All of these tasks work well and up until now we were just using the standard Print (DocuViewareAPI.Print) and Save (DocuViewareAPI.Save) methods to allow the user to save and print the documents. However, for our needs we are wondering if its possible to bypass the standard modal forms that pop up after clicking the Print and Save buttons. By this I mean the small modal windows that allow you to customize the print options (i.e. Destination, Content, Pages, etc.) and save options (File name, Destination format, pages, etc.). For our needs we always want to have the same settings (i.e. always save as pdf with all pages and annotations) and not give the users any means to change or even see these settings. Is there a way to call the Print and Save methods without popping up the modals first, just go directly to the browser's standard Print and Save As dialogs? Basically cut out the middle step of showing the settings modal. Maybe something along the lines of AddRectangleAnnotInteractive where you pass in the properties to the method so you don't need to pop up the 'Rectangle Annotation Properties' modal each time. Is there a similar type way of calling the Print and Save functionality?

Code: Select all

function RedactContent(ViewerName) {
    rectProperties = {
        fill: true,
        fillColor: "#000000",
        stroke: false
    }
    var enabledProperties = [];
    DocuViewareAPI.AddRectangleAnnotInteractive(ViewerName, rectProperties, false, enabledProperties);
}
For the saving, we tried having a custom button (and code-behind method) on the page to export the loaded and edited document and even though we could save the file with no issues it turned out it wouldn't contain any of the actual edits to the file. It would just export the original file but wouldn't include any of the edits that were done to the file and would still contain the deleted pages. Not sure if we were saving the file incorrectly or not, but we couldn't seem to get it to work. In the code behind we would get the loaded document using the "Dim status As GdPictureStatus = DocuVieware1.GetNativeImage(ImgID)" code, but this seems to just get the initially loaded document (without the edits), unless this is the incorrect way we should be getting the file.

Our experience with working with third-party API's like this is very limited so we could just be missing some things about this process.

Any help or ideas would be appreciated.
Thanks

User avatar
Fabio
Posts: 173
Joined: Thu Aug 27, 2020 9:57 am

Re: Print and Save Question

Post by Fabio » Fri Aug 28, 2020 12:20 pm

Hello Perry,

Very sorry for the delay.

You can bypass the form by developing a custom save method.
If you don't have the annotations in your document it is certainly because you set the DropAnnot parameter to true.
Can you try this code and tell me if it works?

GdPictureStatus status = e.docuVieware.SaveAsPDF(PdfConformance.PDF1_7, fs, "*", false);

The SaveAsPDF method have 4 arguments, the first one is the saved file's PDF version you want, the second one is the file stream of your document, third one is the number of pages you want to save ("*" = all pages), and the last is if you want to include or not the annotations on your save.

You can develop a custom form at the file save to let the user choose these arguments and pass in from the client to the server using the PostCustomAction.

Regards,
Fabio de Rose
Solution Engineer

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest