Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Jul 16, 2019 6:13 am

Hello,

I'm using Free Spire.Doc but I have serious doubts:
1 - I have read it is limited to 500 paragraphs and 25 tables. I understand it's per PDF, is not?
2 - Could I use PdfJavaScriptAction without limitations?
I was trying disable print button by script:
using (Spire.Doc.Document document = new Spire.Doc.Document())
using (MemoryStream memoryStreamReader = new MemoryStream(templateFile))
using (MemoryStream memoryStreamWriter = new MemoryStream())
using (MemoryStream memoryStreamWriter2 = new MemoryStream())
{
document.LoadFromStream(memoryStreamReader, FileFormat.Auto);
document.MailMerge.Execute(entity);
document.SaveToStream(memoryStreamWriter, FileFormat.PDF);
var script = "this.print(" + false + ");\r";

Spire.Pdf.PdfDocument doc = new Spire.Pdf.PdfDocument(memoryStreamWriter);
PdfJavaScriptAction action = new PdfJavaScriptAction(script);
doc.AfterOpenAction = action;
doc.SaveToStream(memoryStreamWriter2, Spire.Pdf.FileFormat.PDF);
return memoryStreamWriter.ToArray();
}

Regards,

nagdalion
 
Posts: 11
Joined: Tue Jul 16, 2019 6:08 am

Tue Jul 16, 2019 8:40 am

Hello,

Thanks for your inquiry. Below are my answers to your questions.
1. The limitation "500 paragraphs and 25 tables" is enforced during reading or writing word documents. It is for per word rather than per PDF. When converting word documents to PDF, you can only get the first 3 page of PDF file. And we don't maintain our free version regularly. Our commercial version has no limitation, and it is more stable than the free version. Hence, I would suggest that you download our commercial version (Spire.Doc Pack(hot fix) Version:7.6.16) to evaluate our product better.
2. The PdfJavaScriptAction is the class of our Spire.PDF. There is no limitation when using it.
If there is any question, please feel free to write back.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Tue Jul 16, 2019 9:15 am

Hello Nina,

I have installed the free version and, when I save a file, from .docx to pdf, I receive the nest text: "Evaluation Warning : The document was created with Spire.PDF for .NET."
It's a doc with only page.

The free version allow convertion and Standard no, and I'm only going to save documents with one page.

With the PdfJavaScriptAction control, I'm trying to disable print button, is it possible?

Regards,

nagdalion
 
Posts: 11
Joined: Tue Jul 16, 2019 6:08 am

Tue Jul 16, 2019 10:37 am

Hi,

Thanks for your quick feedback.
1. In our free Spire.Doc package, there are three dlls (Spire.Doc.dll, Spire.Pdf.dll, Spire.License.dll). Kindly note the Spire.Doc and Spire.Pdf are two different products. The reason why the Spire.Doc contains the Spire.Pdf.dll is that some features of our Spire.Doc have dependencies on the Spire.PDF. The Spire.Pdf.dll in the free Spire.Doc is the commercial dll. The conversion from word to Pdf is the features of our Spire.Doc. There will be no evaluation message generated. You were adding the PdfJavaScriptAction for Pdf, this operation belongs to the feature of our Spire.PDF. Hence, you got the evaluation warning. For your situation, please download our Free Spire.Office for .NET Version:4.3 which contains free Spire.Doc and free Spire.Pdf to test again.
2. About how to disable print button with the PdfJavaScriptAction , I will further investigate it, will update you ASAP.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Tue Jul 16, 2019 10:58 am

OK, Nina.

Thanks for your soon reply.

I hope news about of PdfJavaScriptAction.

Regards,

nagdalion
 
Posts: 11
Joined: Tue Jul 16, 2019 6:08 am

Wed Jul 17, 2019 8:00 am

Hello,

Thanks for your waiting.
Our Spire.PDF follows the rules of PDF standard. In which, "enable/disable" print belongs to the restriction of PDF security. You could disable the print button by the following code. And I attached a screenshot here for your reference. I'm afraid there is no way to control print button via JavaScript code. If there is any question, please feel free to write back.
Code: Select all
Spire.Pdf.PdfDocument doc = new Spire.Pdf.PdfDocument("input.pdf");
doc.Security.Encrypt("password", PdfPermissionsFlags.EditContent| PdfPermissionsFlags.CopyContent| PdfPermissionsFlags.EditAnnotations|PdfPermissionsFlags.FillFields);
doc.SaveToFile("result.pdf", Spire.Pdf.FileFormat.PDF);
Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Wed Jul 17, 2019 8:13 am

Oh, perfect, Nina!!

I'm going to test it now.

Thanks!

What limitations has Free Office?

nagdalion
 
Posts: 11
Joined: Tue Jul 16, 2019 6:08 am

Wed Jul 17, 2019 8:57 am

Hello,

Thanks for your prompt reply.
Free Spire.Office has page limitation for the Word, PDF and other format documents. The following contents show the details for the limitations of Word and PDF.
1). For Word document, free version is limited to 500 paragraphs and 25 tables. This limitation is enforced during reading or writing files. When converting word documents to PDF and XPS files, you can only get the first 3 page of PDF file.
2). For PDF document, it is limited to 10 pages of PDF. This limitation is enforced during loading and creating files. When converting PDF to Image, the first 3 pages of PDF files will be converted to Image format successfully.
In addition, our commercial version contains more fixes and new features, which is stranger than the free version. Any confusion, please do not hesitate to write back.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Wed Jul 17, 2019 9:49 am

Hi, Nina,

For our environment, we don't need to work with more pages in word or pdf files.
Is the commercial version paid for?
In my office they believe that with the free version, as it does not require more
requirements that to generate invoices of 1 or 2 pages, the free version would be valid.

Greetings,

nagdalion
 
Posts: 11
Joined: Tue Jul 16, 2019 6:08 am

Wed Jul 17, 2019 10:06 am

Hi,

Yes, the commercial version is the paid version. Based on your description, our Free Spire.Office could meet you task. Just go ahead.
BTW, did you test the code I provided? Did it achieve your task? Thanks in advance for your feedback.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Wed Jul 17, 2019 10:21 am

Hello Nina,

Your code is perfect!!

Tnaks for your reply.

Regards,

nagdalion
 
Posts: 11
Joined: Tue Jul 16, 2019 6:08 am

Wed Jul 17, 2019 10:23 am

Hi,

Thanks for your feedback.
If there is anything we can do for you in the future, please feel free to contact us.
Wish you all the best!

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.Doc