IPXV_Document::Save Method
From PDF XChange PDF SDK
m (Automatic page editing by robot) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
{{#customTitle:IPXV_Document::Save Method}} | {{#customTitle:IPXV_Document::Save Method}} | ||
{{#parentPage:PXV:IPXV_Document#Methods|Save|method}} | {{#parentPage:PXV:IPXV_Document#Methods|Save|method}} | ||
− | |||
{{ToReview}} | {{ToReview}} | ||
Line 20: | Line 19: | ||
== Parameters == | == Parameters == | ||
;pDest | ;pDest | ||
− | :[in, defaultvalue(NULL)] Pointer to IUnknown*. | + | :[in, defaultvalue(NULL)] Pointer to IUnknown* containing the destination file path. Can be ether [[PXV:IAFS_Name|IAFS_Name]], IStream or NULL. If NULL is specified then the document will be saved to the original file. If the document is newly created, the Save As... dialog will be shown. |
;nFlags | ;nFlags | ||
− | :[in, defaultvalue(0)] | + | :[in, defaultvalue(0)] Specify the [[PXV:PXV_DocSaveFlags|document save flags]]. |
;pProgress | ;pProgress | ||
− | :[in, defaultvalue(NULL)] Pointer to [[PXV:IProgressMon|IProgressMon]]. | + | :[in, defaultvalue(NULL)] Pointer to [[PXV:IProgressMon|IProgressMon]] containing the custom initialized progress. |
;pDestConv | ;pDestConv | ||
− | :[in, defaultvalue(NULL)] Pointer to [[PXV:IPXV_ExportConverter|IPXV_ExportConverter]]. | + | :[in, defaultvalue(NULL)] Pointer to [[PXV:IPXV_ExportConverter|IPXV_ExportConverter]] containing custom export converter. |
;pDestConvParams | ;pDestConvParams | ||
− | :[in, defaultvalue(NULL)] Pointer to [[PXV:ICab|ICab]]. | + | :[in, defaultvalue(NULL)] Pointer to [[PXV:ICab|ICab]] containing custom export converter cab settings. |
;pDestFS | ;pDestFS | ||
− | :[in, defaultvalue(NULL)] Pointer to [[PXV:IAFS_FileSys|IAFS_FileSys]]. | + | :[in, defaultvalue(NULL)] Pointer to [[PXV:IAFS_FileSys|IAFS_FileSys]] containing destination file system. |
;pAdvancedParams | ;pAdvancedParams | ||
− | :[in, defaultvalue(NULL)] Pointer to [[PXV:ICab|ICab]]. | + | :[in, defaultvalue(NULL)] Pointer to [[PXV:ICab|ICab]] containing advanced cab parameters that will be available from the saving document events. |
;hWndParent | ;hWndParent | ||
− | :[in, defaultvalue(0)] Value of HANDLE_T. | + | :[in, defaultvalue(0)] Value of HANDLE_T containing the parent window handle. |
== Return Value == | == Return Value == | ||
Returns S_OK if operation was successful or error code in other cases. | Returns S_OK if operation was successful or error code in other cases. | ||
+ | |||
+ | == Sample == | ||
+ | <pre class="brush:c#">//C# | ||
+ | private void SaveDocument(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst) | ||
+ | { | ||
+ | //Performing save to the same file | ||
+ | Doc.Save(); | ||
+ | //Performing save to the specified file without the progress bar | ||
+ | PDFXEdit.IAFS_Inst fsInst = (PDFXEdit.IAFS_Inst)Inst.GetExtension("AFS"); | ||
+ | PDFXEdit.IAFS_Name destPath = fsInst.DefaultFileSys.StringToName("D:\\TestFile.pdf"); //Converting string to name | ||
+ | Doc.Save(destPath, (int)PDFXEdit.PXV_DocSaveFlags.PXV_DocSave_NoProgress); | ||
+ | //Saving document as pdfa (for this the PDFA plugin should be registered) | ||
+ | PDFXEdit.IPXV_ExportConverter cnv = null; | ||
+ | for (uint i = 0; i < pdfCtl.Inst.ExportConvertersCount; i++) | ||
+ | { | ||
+ | if (pdfCtl.Inst.ExportConverter[i].ID == "conv.exp.pdfa") | ||
+ | cnv = pdfCtl.Inst.ExportConverter[i]; | ||
+ | } | ||
+ | if (cnv != null) | ||
+ | { | ||
+ | PDFXEdit.ICab cab = pdfCtl.Inst.GetFormatConverterParams(false, "conv.exp.pdfa"); | ||
+ | pdfCtl.Doc.Save(destPath, 0, null, cnv, cab); | ||
+ | } | ||
+ | } | ||
+ | </pre> | ||
+ | |||
== See Also == | == See Also == | ||
[[PXV:IPXV_Document|IPXV_Document]] | [[PXV:IPXV_Document|IPXV_Document]] |
Latest revision as of 03:33, 27 July 2016
The method of interface of PDF-XChange Editor SDK.
Syntax
HRESULT Save([in, defaultvalue(NULL)] IUnknown* pDest, [in, defaultvalue(0)] LONG nFlags, [in, defaultvalue(NULL)] IProgressMon* pProgress, [in, defaultvalue(NULL)] IPXV_ExportConverter* pDestConv, [in, defaultvalue(NULL)] ICab* pDestConvParams, [in, defaultvalue(NULL)] IAFS_FileSys* pDestFS, [in, defaultvalue(NULL)] ICab* pAdvancedParams, [in, defaultvalue(0)] HANDLE_T hWndParent);
Parameters
- pDest
- [in, defaultvalue(NULL)] Pointer to IUnknown* containing the destination file path. Can be ether IAFS_Name, IStream or NULL. If NULL is specified then the document will be saved to the original file. If the document is newly created, the Save As... dialog will be shown.
- nFlags
- [in, defaultvalue(0)] Specify the document save flags.
- pProgress
- [in, defaultvalue(NULL)] Pointer to IProgressMon containing the custom initialized progress.
- pDestConv
- [in, defaultvalue(NULL)] Pointer to IPXV_ExportConverter containing custom export converter.
- pDestConvParams
- [in, defaultvalue(NULL)] Pointer to ICab containing custom export converter cab settings.
- pDestFS
- [in, defaultvalue(NULL)] Pointer to IAFS_FileSys containing destination file system.
- pAdvancedParams
- [in, defaultvalue(NULL)] Pointer to ICab containing advanced cab parameters that will be available from the saving document events.
- hWndParent
- [in, defaultvalue(0)] Value of HANDLE_T containing the parent window handle.
Return Value
Returns S_OK if operation was successful or error code in other cases.
Sample
//C# private void SaveDocument(PDFXEdit.IPXV_Document Doc, PDFXEdit.IPXV_Inst Inst) { //Performing save to the same file Doc.Save(); //Performing save to the specified file without the progress bar PDFXEdit.IAFS_Inst fsInst = (PDFXEdit.IAFS_Inst)Inst.GetExtension("AFS"); PDFXEdit.IAFS_Name destPath = fsInst.DefaultFileSys.StringToName("D:\\TestFile.pdf"); //Converting string to name Doc.Save(destPath, (int)PDFXEdit.PXV_DocSaveFlags.PXV_DocSave_NoProgress); //Saving document as pdfa (for this the PDFA plugin should be registered) PDFXEdit.IPXV_ExportConverter cnv = null; for (uint i = 0; i < pdfCtl.Inst.ExportConvertersCount; i++) { if (pdfCtl.Inst.ExportConverter[i].ID == "conv.exp.pdfa") cnv = pdfCtl.Inst.ExportConverter[i]; } if (cnv != null) { PDFXEdit.ICab cab = pdfCtl.Inst.GetFormatConverterParams(false, "conv.exp.pdfa"); pdfCtl.Doc.Save(destPath, 0, null, cnv, cab); } }