Moderators:PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
Forum rules DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Hey guys... this is a follow-up to viewtopic.php?t=39453 and I have been using https://sdkhelp.pdf-xchange.com/vi ... tractPages.
My problem ... I cannot figure out how to export the page to a byte array. I store everything within a SQL Server so I need the page (i.e. the page extracted into a new document) in byte array so I can save it to the SQL Server.
Is there some way I can do the page extraction into a separate document instance? Is there a better way to do this? I have tried the copy version using this approach https://sdkhelp.pdf-xchange.com/vi ... _movePages
but I am still getting stuck trying to get the standalone page object
I am sure I am missing something simple ... any suggestions?
Many Thanks!
-Eric
No, you cannot extract just the page object, without a document containing the page.
But you may extract the page to the new document instance via op.document.extractPages operation and with using this option:
extractOp.Params.Root["Options.ExtractPagesAction"].v = 0; // to extract page(s) to new document instance
I thought I had it working but after lots of testing I realize the Inst class is not generating an output. Here is my code ...
Dim pdfDoc As IPXC_Document
Dim v_Inst As IPXV_Inst = PDFPreview.PDFcntrl.Inst
Dim nID As Integer = v_Inst.Str2ID("op.document.extractPages", False)
Dim inputOperation As IOperation = v_Inst.CreateOp(nID)
inputOperation.Params.Root("Options.ExtractPagesAction").v = 0
Dim input As ICabNode = inputOperation.Params.Root("Input")
input.v = PDFPreview.PDFcntrl.Doc
Dim options As ICabNode = inputOperation.Params.Root("Options")
options("PagesRange.Type").v = "Exact"
options("PagesRange.Text").v = "1"
options("FieldsAction").v = 1 'this will flatten the field values into the PDF
options("CommentsAction").v = 2
options("BookmarksAction").v = 0
options("DeletePages").v = False
options("ExtractPagesAction").v = 1
options("OverwriteAll").v = True
options("FileName").v = "Page 1"
options("OpenFolder").v = False
inputOperation.[Do]()
pdfDoc = CType(inputOperation.Params.Root("Output").v, Object)
It runs without error. the pdf control is displaying the starting document with no problems. I am confident the input.v is referencing a legitimate Doc. any suggestions?
means: extract specified pages to the new file on the disc with the name "Page 1".
For your case you need to specify the proper value, as I suggested in my previous reply:
options("ExtractPagesAction").v = 0 // to extract page(s) to new document instance
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Vasyl -
I have searched your online HELP and there is no place that even references the list of parameters such as "ExtractPagesAction" or "FileName". So I do not know where you think I am going to find the definitions for all of these options. Feel free to send me the links to the these because they do not appear in any searches of https://sdkhelp.pdf-xchange.com
I thought FileName referred to the output name of the document and not the input. I am sorry for wasting your time. I will continue to do my best to avoid posting here without exhaustive research on my side. What links can I follow to get a comprehensive list of all available root parameter settings and/or settings for ICabNode?
-Eric