Disable copy function in PDFTRON for Android - pdftron

Is it possible to disable the copy option of the lib when selecting a text in the PDF using the PDFTron lib for Android?
I tried to search for the string, but also have not found it.

If you are using one of the mobile SDK's, or using our PDFViewWPF control for .Net 4+, then this is possible by modifying the tools code that is provided. There will one or two text selection tools, for which you can just comment out. Plus you would want to disable ctrl-c, and right click and select copy abilities. Exact code changes depends on platform. If you are using our older C++ PDFViewCtrl class this is harder to do, but I suspect you are not on this anyway.
Be aware though, there is no real way to prevent a user from extracting text from a PDF, since they can always open it in another PDF viewer and do it there.
See this form post for more info, including how to scramble the unicode values of text.
https://groups.google.com/forum/#!searchin/pdfnet-sdk/disable$20text/pdfnet-sdk/luWQmyhRDTw/z7UIGuu9uYkJ
Note, you will probably be interested in the PDFTron WebViewer technology, which provides much greater control over content. In particular, the original PDF file is never exposed to anyone for download. You can also encrypt the XOD file, so it cannot be opened in an XPS viewer, and you have full control over the UI, including disabling text search/extraction.
https://www.pdftron.com/webviewer/showcase/
https://www.pdftron.com/webviewer/index.html

Related

MBCS File Menus generate ???? Characters

I am working on an MBCS app using MFC. I am trying to support Asian languages. For the purposes of this discussion, we'll say I'm trying to support Chinese. I am able to support Pop up dialogs via MessageBoxW and Dialog SCREENs by pasting Chinese characters directly into the RC file. I can't get file menus to work using either resource view or editing the RC file directly. Whenever I type in ANY Asian character, the screen shows ???. One ? for each character. I have tried modifying the menu in C++ using ModifyMenuW. I get more question marks. Visual Studio shows everything working, and the RC file is unicode (UTF-16). I can't easily convert my project to unicode mode. Spanish, French, and German all works fine (one of the Essets in German doesn't work, but that isn't a show stopper). What should I try next?
Thanks in advance!
Well, the easy answer would be change the application to Unicode, but this is not always simple, or possible at all.
Concerning using Unicode in a MBCS application, some things are possible and some others not. For example, I have made a MBCS application displaying and editing translations of program strings (messages, menues etc) in a ListView control, however ListView does have a specific message to turn it to Unicode (LVM_SETUNICODEFORMAT) and support operations (see also CCM_SETUNICODEFORMAT). Menus aren't controls though, but they do have "wide" (Unicode) functions.
If you want to use Unicode in your application, there are some tests you need to make. Success is not guaranteeded, but you can at least draw some conclusions and determine whether what you want to do is possible.
Test1:
You mentioned trying ModifyMenuW(), but this will try to modify an existing menu. Instead, try InsertMenuW() or InsertMenuItemW(). Any unicode string should be displayed properly, so try not just Chinese, but other laguages too (eg Greek or Russian). And btw, I can't see how French works and German doesn't (they use the same codepage - West European). What's the system codepage of your test-machine?
Test2: (if the above has failed)
Try changing the whole menu (SetMenu()) with having a single (unicode) menu item as its root.
Test3: (if the above have failed)
Then you need to check whether the window containing the menu must be Unicode. Create a simple "Hello World" Win32 application, or find a sample, if Visual Studio does not do this for you (these basically register the window class, create the main window and start the message-loop) - you must add a menu too, using the "wide" version of the menu functions explicitly. If this doesn't work, try changing the code that creates the window to unicode. This way you will know whether you need a unicode window, to own the menu.
Please make these tests and let us know the results. I will further post if needed.

Unwanted chars appended while rendering partial view in nodejs and expressjs

I'm trying to use nested view with DustJS (linkedin fork) with ExpressJS. While rendering the response system generates some escape chars in response. Which disturb the style and theme.
The same code renders fine as one view file, but when split code into two view files (one load as partial) than the problem arise.
Interesting thing is, it happens with two view engines I tried, the same issue, ECT and DustJS. Development on minimal components, Twitter Bootstrap 3.0 and express are additional component added so far.
My machine is running windows as operating system and development tool is visual studio. What could be reasons, has anyone find same trouble with these view engines?
View in Google Chrome Developer Tool.
Response-Text View
I tried to fiddle and tried to map the extra chars.
You have an UTF-8 BOM in one of the files you are using, usually in the first 3 bytes. Normally, a text editor will not show you these characters. Examine your used files with a hex editor (or write a script that examines those files for you) & store the offending file without that UTF-8 BOM, and configure all your editors to omit the BOM in future.
In addition to Wrikken's answer, if you are using Visual studio than it cab be fixed by advance save option.

Viewing Word Documents inside Browsers

I'm searching for some kind of Programm / Java Applet / ActiveX Control or magic spell to view Word / Excel Documents inside Browsers (Browser independent would be the best case, but IE only ist just fine).
I don't want to open Word itsself inside a frame, because that gives users the false impression that they can edit and save the document i just want to display its contents.
I also found solutions which converts the word document to pdf first, but i can't do this due to some security restrictions on the environment i'm working on.
This can help when those proprietary file formats can first be converted to ODF (for example by LibreOffice/OpenOffice.org): http://webodf.org/
(I will not comment on "security restrictions" and using Microsoft software ...)

MFC Application in VC++

I have developed a desktop application using MFC, which has FILE, EDIT, VIEW and HELP options,along with one pen to write on the opened document which saves as test1. It is allowing me to open only test1 or test2 etc. Apart from these types of files, if i want to open PPTs or PDFs how can i do it?
The code to open a file is autogenerated by Visual Studio 2008. Now i need to modify the same.
This is something Microsoft doesn't provide any Wizards to do (at least not directly). The basic idea is that you have to create and add new document and view classes for the new file types. Then you need to add document strings to the string table to describe the association between the file extensions and the document/view classes. Then you register each document/view pair in the app class using the strings you added to the string table.
By far the easiest way to do this is to generate the document, view, and string in another (otherwise throwaway) application, grab the document, view, registration string and registration code from that application and put them into your application. Then generate another throwaway application for the next file extension.
That gives you a skeleton doc/view for each file extension. From there, it's up to you to write the code to actually open, display, edit, save, etc., that type of file. That's not going to be trivial for either PDF or (especially) PPT -- unless you "delegate" and use something like an ActiveX control to do the real work. If you want to do that, the Adobe ActiveX control works reasonably well (somewhat limited capabilities, but it'll show up essentially the same as a PDF in a web browser). Offhand I don't remember whether MS provides an ActiveX control for viewing PPT files. There is a free PPT viewer, but if memory serves it's an executable, rather than a control.

Can you do complex editing of Word Documents in a browser?

A friend of mine wants to have an application where people can upload documents in Word (or text) format, and then allow people to make edits to those documents within a browser.
Is there any mechanism that would support adding text "bubbles" for adding comments? Either floating, or off to the side.
Being able to save back to Word format is a must too. Or at least, some format supported by Word, that would still be editable. Saving it as an image is not acceptable.
I was thinking about opening the Word Document in an FCK Editor window, but FCK only seems to have "normal" inline text editing capabilities (although it is great).
Is this feasible?
Yes it is feasible. Google has done that (and it does have comments). So has Adobe. I'm sure there is more.
Xopus provides a programmable platform that allows you to define editable XML within a WYSIWYG environment. You could use it to define what you want to edit (XML), against which rules you want to edit it (an XSD) and how you want it to look while you edit it (XSL). Then you tie that all together with the Javascript API.
In other words, you could pretty easily define a document that contains multiple paragraphs with optional comments and then have them displayed as bubbles exactly the way you want them; when saved, a script on the server could be executed that converts the XML to a Word document.
Take a look at the demos.
If they are Word 2007 documents, you can use Silverlight. Here's an example application that uses Silverlight to open a Word 2007 document and display it in the browser.
Since StackOverflow is a programmer site, I'll assume you're a programmer. You can use Silverlight to add the bubbles and annotations to a Word 2007 document, but you'll need to know VB.NET or C#.
Take a look at docx2web.appspot.com which is (currently) a very bare bones editor with the distinguishing feature that the browser is directly manipulating (more or less) the "flat OPC" version of the docx.
This means that there is no lossy conversion on either the way in or the way out. So for example, when you save after editing, anything which was in the original docx is round tripped back to Word.
As far as support for older .doc is concerned, POI can be used to convert them to .docx (although your mileage may vary).
Why are you trying to compete with google docs?
I know that TinyMCE provides some rich controls for in browser editing. Last time i looked at it, it had 100% of the stuff i would normally use in word, and then some. On the other hand, i probably has 1% of the features that MS word provides. It would be VERY difficult to implement it all.
As far as saving to MS word compatible format. i am sure its possible. it would probably be easier to save to a non-doc format.
As far as popups etc, those can be easy built using jquery UI or any other javascript framework.
Bottom line: yes, its possible, but why?!
It is possible. For example eyeOS has a text processing application able to open and process Microsoft Office and OpenOffice.org text documents.

Resources