image to pdf.

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

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.
Post Reply
vivekpatel
User
Posts: 141
Joined: Sat Aug 27, 2016 11:00 am

image to pdf.

Post by vivekpatel »

Hello,

I have Memorystream of image like tif flie. Now i want to convert this memorystream to pdf file.

I did code as below

Dim docBytes As Byte()
Dim Doc12 As PDFXEdit.IPXC_Document

docBytes = GetBytesFromFile("Here is my tiff file")

Dim _FileMemorystream As New MemoryStream(docBytes)

Dim srcIStream As IStreamWrapper = New IStreamWrapper(_FileMemorystream)

Doc12 = iConv.Convert(CType(m_Inst, PDFXEdit.PXV_Inst), srcIStream)

m_nID = m_Inst.Str2ID("op.imagesToDoc", False)
Op = m_Inst.CreateOp(m_nID)
Input = Op.Params.Root("Input")
Input.Add().v = fsInst.DefaultFileSys.StringToName(data.sDoc)

Dim options As PDFXEdit.ICabNode = Op.Params.Root("Options")
m_Inst.AsyncDoAndWaitForFinish(Op, 0)
Dim output As PDFXEdit.ICabNode = Op.Params.Root("Output")
Dim newCoreDoc As PDFXEdit.IPXC_Document
newCoreDoc = CType(output(0).Unknown, PDFXEdit.IPXC_Document)
newCoreDoc.WriteToFile("C:\Users\Vivek\Documents\Docsvault Checkout Folder\NewPDF.pdf")
Op.Do()
Doc12.Close()

so, how to convert image(memorystream) to pdf ?
Regards.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: image to pdf.

Post by Sasha - Tracker Dev Team »

Hello vivekpatel,

From what I see, that operation does not support the IStream as an input:
https://sdkhelp.pdf-xchange.com/vie ... magesToDoc
The best way would be to open the document directly from IStream like you did here:
https://www.pdf-xchange.com/forum3 ... morystream

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply