Hi Michale,
Thank you for evaluating Syncfusion product.
Here is the answers for your questions,
1.DocToPDF
We don't have direct option to convert from Doc to PDF. But we have implemented new conversion from doc to HTML in our Volume 3 release. Through this we can workaround for Doc to PDF. Already we have support for HTML to PDF. So doc to PDF can be achieved by convert the specific doc to HTML and then convert HTML to PDF.
Code snippet for doc to HTML,
'Open the document to convert from word to HTML
Dim doc1 As WordDocument = New WordDocument(textBox1.Text)
Dim htmlExport As HTMLExport = New HTMLExport()
'Export the doc to HTML and save as .html file
strHtml = Application.StartupPath & "doctohtml_res.html"
doc1.SaveOptions.HtmlExportImagesFolder = Application.StartupPath
htmlExport.SaveAsXhtml(doc1, strHtml)
Code snippet for HTML to PDF,
Using html As HtmlConverter = New HtmlConverter()
Using img As Image = html.ConvertToImage(strHtml, ImageType.Metafile, CInt(Fix(width)), -1, dimension)
Dim metafile As PdfMetafile = CType(PdfImage.FromImage(img), PdfMetafile)
Dim format As PdfMetafileLayoutFormat = New PdfMetafileLayoutFormat()
format.Break = PdfLayoutBreakType.FitPage
format.Layout = PdfLayoutType.Paginate
pdf.PageSettings.Height = img.Height
format.SplitTextLines = False
metafile.Draw(page, New RectangleF(0, 0, pageSize.Width, -1), format)
Here is the sample for your reference:
http://websamples.syncfusion.com/samples/PDF.Windows/73215/Pdf_Window_73215.zipPlease add the below assemblies before run the sample:
1. AxSHDocVw.dll
2. SHDocVw.dll
3. Syncfusion.DocIO.Base.dll
4. Syncfusion.Core.dll
5. Syncfusion.Compression.Base.dll
6. syncfusion.htmlconverter.base.dll
7. syncfusion.pdf.base.dll
Note:
we do have only limited support for doc to HTML. Not all the elements are converted to HTML page.
Please try this and let us know if this helps you.
2. Read from PDF Document
If your intention is to read an existing PDF document, it can be achieved by using the PdfLoadedDocument.
'Load a PDF document
PdfLoadedDocument ldoc = new PdfLoadedDocument("Manual.pdf")
ldoc.Save("Sample.pdf");
If I have misunderstood your requirement, could you please explain me in detail, so that I can work in depth and try to send a better solution?
Regards,
Suba