iText 7.7.1.16 - cannot open pdf document - itext7

I used itextsharp 5 for years, now I am testing iText 7 (v7.7.1.16.). I have a very strange issue with a simple code:
Dim src As String = My.Application.Info.DirectoryPath + "\test.pdf"
Dim reader As PdfReader = New PdfReader(src)
Dim pdfDoc As PdfDocument = New PdfDocument(reader)
the pdfdocument instance fails with error "Cannot open document" iText.Kernel.PdfException.
The file exists and the current user has access to read it (Copying the complete path during debug, I have got a working path: pdf opens in adobe acrobat). I tried to move file in another location, but the issue still occurs. I tried also with different pdf files.
Any ideas?
Thanks!
EDIT: I examined inner exception: unable to load assembly 'Common.Logging, Version=3.4.1.0, Culture=neutral, PublicKeyToken=af08829b84f0328e' but I added the reference to my project...

Related

Applescript: pdf to pptx conversion

I'm trying to convert pdf to pptx invoking adobe acrobat using AppleScript.
Below code executes fine without any error but there isn't any output created.
--somecode--
save active doc to filePath using conversion "com.adobe.acrobat.pptx"
conversion using text class works fine.
save active doc to filePath using conversion "com.adobe.acrobat.plain-text"
I found this on adobe forum, and it remained unresolved(pdf to html).
https://community.adobe.com/t5/acrobat-sdk/pdf-to-html-conversion-with-interapplication-communication-api-in-mac-os/td-p/9294002
Just to add I'm using adobe acrobat pro dc trial version.
Thanks
I was able to make it work. Used AppleScript to invoke adobe javascript.
Going through posts in various forums, found a user following the same approach for rtf documents.
set myScript to "this.saveAs(\""& output_file_path && "\", \"com.adobe.acrobat.pptx\");"
do script myScript
instead of
save active doc to filePath using conversion "com.adobe.acrobat.pptx"

Microsoft Word Automation - Embedding Word in MFC - Error saving the document

I am trying to embed microsoft word inside an MFC SDI SDK application. And I could able to do this using the below link :
How to embed and automate a Word document with MFC
But when trying to save the document, it is throwing an error message. Below is the code for saving the document.
LPDISPATCH lpDisp;
lpDisp = m_pItem->GetIDispatch();
_Document doc;
doc.AttachDispatch(lpDisp);
doc.Save();
Here I am trying to save the document which is already opened using the below function:
CString strPath = "D:\\Test.doc";
m_pItem->CreateFromFile(strPath, m_clsid);
Following is the error message when calling the function doc.Save():
The save method or property is not available because this document is
being edited in another program

PDFClown - Compressing PDF

I am trying to compress PDF files using PDFClown 0.1.2, but i am facing issue like when i try to open PDF it says "An Error exists on this page"
also tried the approach mentioned in link
Stack
Below is the my code
org.pdfclown.files.File file = new org.pdfclown.files.File(newPath);
org.pdfclown.tools.Optimizer.RemoveOrphanedObjects(file);
file.Document.Configuration.XrefMode = Document.ConfigurationImpl.XRefModeEnum.Compressed;
file.Save(org.pdfclown.files.SerializationModeEnum.Standard);
Please let me know if any one has face the same issue
Thanks

Save file in vbscript with fpdf

Sorry, my english isn't good.
I have created a pdf file with fpdf in vbscript but when I try to save it directly on a particular path is opened in the browser. Can I save directly or only opens in the browser ?. This is my code:
Dim pdf
Set pdf=CreateJsObject("FPDF")
pdf.CreatePDF
pdf.SetPath("fpdf/")
pdf.SetFont "Arial","B",16
pdf.Open()
pdf.AddPage()
pdf.Cell 40,10,"Hello, world!"
pdf.Close()
filewrite=Server.MapPath("pdf/new.pdf")
pdf.Output filewrite

Export to PDF file

I am evaluating Teechart 4.1.2012.2287 and I have a problem with the export to PDF function.
My project is written in VS2010, using VB.Net and framework 4.0, and I have Adobe Reader 9.4.7 on my PC.
When I try to open a PDF generated by TChart it says there is an error with the file.
I also get this problem using your Example application.
Is there a version requirment for the Reader?
I'm afraid this is a bug. I get this error message:
An error exists on this page. Acrobat may not display the page
correctly. Please contact the person who created the PDF document to
correct the problem.
Do you get the same? Anyway, I added the issue (TF02016129) to the bug list to be investigated.

Resources