Discussion Forums  >  Images, Documents, File Locations

Replies: 10    Views: 177

Maximilien_Robespierre
Aspiring developer
Profile
Posts: 45
Reg: Sep 11, 2013
Costa Mesa
4,250
10/17/13 11:07 AM (10 years ago)

Preserving pdf and MS Word hyperlinks in compiling to an Android app

I am now membership status on BT - I guess it means I am full on committed to the BT Way (tip of the hat to Tim Wolf who I contacted on something unrelated. He confirmed BT is the way to go). A centerpiece of my intended apps is to utilize pre-existing pdf and MSWord docs with existing internal hyperlinks and bookmarks, then compile them into my app design preserving those "go to" navigation devices such that large documents can easily be navigated on a mobile device. Preservation of the hyperlinks/bookmarks pre-compiling is critical; in most cases my documents come to me "ready to wear" and the thought of reconstructing the links postcompilation seems like unnecessary redundancy. Yet after scouring this site, Android, and internet resources I cannot yet find an elegant solution (I love elegant solutions!)that preserves links and carries them over to the finished BT/Android app. This posting illustrates the issues and problems of constructing an elegant solution. <a href="http://tex.stackexchange.com/questions/14620/how-to-preserve-hyperlinks-in-included-pdf" target="_blank" rel="nofollow">http://tex.stackexchange.com/questions/14620/how-to-preserve-hyperlinks-in-included-pdf</a> In my extensive web travels in search of an answer, I conclude that Android "textview" and "linkify" are related to the issue, but do not address the "preservation" character of the solution I seek. I am puzzled by the absence of an easy answer/solution, since it seems a priori a common need and requirement. Any guidance in the direction of a solution - even if it is a custom built plugin - would be greatly appreciated! MR
 
Maximilien_Robespi...
Aspiring developer
Profile
Posts: 45
Reg: Sep 11, 2013
Costa Mesa
4,250
like
10/18/13 12:30 PM (10 years ago)
Update: Problem and Potential Solution From a tex.stackexchange.com (stackoverflow.com forum)post: How to preserve hyperlinks in included PDF? I have generated PDFs with figures that have hyperlinks (hyperref to websites, \href) in them. When I compile these figures standalone the hyperlinks work. But when I try to include these PDFs (as figures, not the sources) with \includegraphics the links are lost and only the image is inserted in the document. Is there a way to include (\includegraphics?) a PDF such that its original links work in the master document? This question has to do with the externalization (e.g. TikZ or PGFPlots), which also suffers from these drawbacks, i.e. hyper-references are lost. graphics hyperref pdf links embedding shareimprove this question edited Jul 21 at 8:50 asked Mar 31 '11 at 0:52 alfC 3,141826 3 Answers activeoldestvotes up vote 13 down vote accepted You can not simply mix two PDF files. You have to preserve PDF document structure. In the simply case links (PDF annotations) are dropped. You can try the PAX project, which trys to extract and reinsert the PDF annotations. shareimprove this answer answered Mar 31 '11 at 7:30 Josef 2,5921826 although using a Java from PAX is far from ideal I will mark this as accepted answer until a better option appears. – alfC Apr 5 '11 at 7:36 1 For an example on how to use pax, see Embedding a pdf file with clickable external links into a LaTeX document – diabonas Feb 16 '12 at 14:37 up vote 9 down vote It seems that pdftex always drops all PDF annotations (which includes hyperlinks) from the included file. The PDF format itself makes it rather difficult to do otherwise. PDF annotations are laid out in a completely different way to how the rest of the content of the page is constructed. They live on a different layer and they are positioned using a different (page-absolute) coordinate system. shareimprove this answer answered Mar 31 '11 at 3:31 Lev Bishop 23.7k152107 <a href="http://tex.stackexchange.com/questions/14620/how-to-preserve-hyperlinks-in-included-pdf" target="_blank" rel="nofollow">http://tex.stackexchange.com/questions/14620/how-to-preserve-hyperlinks-in-included-pdf</a> The Pax solution leads to this: The pax package mentioned is actually a Java program which reads the PDF file, extracts the links and writes their positions to a .pax file. This information can be processed by an extended version of \includegraphics which reinserts the links at the correct position. However, the package is considered experimental and only works with pdfLaTeX. This is how to use pax: Download and install the package from CTAN. Run pdfannotextractor.pl --install. This downloads and installs PDFBox, a Java library necessary for using pax. Now you can run pdfannotextractor.pl <filename.pdf> in order to read the links from any given PDF file and write them to filename.pax. In your LaTeX document, invoke \usepackage{pax}. This extends \includegraphics in order to read and process the auxiliary .pax file. <a href="http://tex.stackexchange.com/questions/26128/embedding-a-pdf-file-with-clickable-external-links-into-a-latex-document/44104#44104" target="_blank" rel="nofollow">http://tex.stackexchange.com/questions/26128/embedding-a-pdf-file-with-clickable-external-links-into-a-latex-document/44104#44104</a> Next roadblock: however, I cannot find a site with a server to run pdfannotextractor.pl Opening PL files Did your computer fail to open a PL file? We explain what PL files are and recommend software that we know can open or convert your PL files. What is a PL file? Files that contain the .pl file extension usually hold script that has been written in the Perl programming language. Perl is a high-level dynamic programming language that was initially developed in 1987 by Larry Wall. Multiple PL scripts can be compiled and run using a Perl interpreter. PL files are commonly used to design applications that parse and analyze text as well as Web server CGI scripts. It is very rare to see the .pl file extension used on the Web. This is due to the fact that the Perl scripts are normally run through web server CGI scripts when being used on the Internet. Software that will open or convert PL files Notepad++ Download Now ALLPlayer Download Now MasterCook <a href="http://file.org/extension/pl#" target="_blank" rel="nofollow">http://file.org/extension/pl#</a> ___ As the above states, Notepad++ will open the file so it can be read, but cannot be run without web server CGI scripts. I have not yet found such a web server. "Where's Waldo" continues on.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
10/18/13 04:10 PM (10 years ago)
It is all okay on iPhone / iPad ? -- Niraj
 
Maximilien_Robespi...
Aspiring developer
Profile
Posts: 45
Reg: Sep 11, 2013
Costa Mesa
4,250
like
10/18/13 04:21 PM (10 years ago)
Haven't tried to compile to Xcode yet
 
Maximilien_Robespi...
Aspiring developer
Profile
Posts: 45
Reg: Sep 11, 2013
Costa Mesa
4,250
like
10/19/13 12:28 PM (10 years ago)
I'm closing in on a solution. Waldo seems to be hiding within: Perl is a programming language suitable for writing simple scripts as well as complex applications - see <a href="http://www.perl.orgStrawberry" target="_blank" rel="nofollow">http://www.perl.orgStrawberry</a> Perl is a perl environment for MS Windows containing all you need to run and develop perl applications. It is designed to be as close as possible to perl environment on UNIX systems.It includes perl binaries, compiler (gcc) + related tools, all the external libraries (crypto, graphics, xml ...), all the bundled database clients and all you expect from Strawberry Perl. <a href="http://strawberryperl.com/" target="_blank" rel="nofollow">http://strawberryperl.com/</a> This appears to be a key to installing PDFbox and the pax package These require installation of Miktex http://miktex.org/2.9/setup and LaTex (TextLive) (find it on the CTAN site: http://www.ctan.org/pkg/ one is a text and font application and the other is a manager for writing text and font control in different IDE. What the pax package does - and apparently nothing else in existence does - is to take the coding of a hyperlink in PDF, save it into a pax file, then reinstall it into text-compiled-into-app at the proper place. All other compilers wipe out the hyperlink coding on compiling. If anyone is capable of constructing a a plugin to do this, you would be blazing new ground as far as I can discern, with a good chance of monetization to boot. When all the installations are complete and I have a chance to test drive it, I'll report back with the results. MP
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
10/19/13 06:49 PM (10 years ago)
Hello Perl does not run on the mobile device. Lets try a simple test with an existing PDF that has many internal links in the Table of Contents. Woth your mobile device, go to the How-To section of this web site and search for my first name. Find the one related to Push Notifications. https://www.buzztouch.com/resources/ Then open that document on your mobile device. Go to the Table of Contents. Tap on any item, it should take you to that page and place within the PDF. Let us know how you get along. -- Niraj
 
Maximilien_Robespi...
Aspiring developer
Profile
Posts: 45
Reg: Sep 11, 2013
Costa Mesa
4,250
like
10/19/13 07:12 PM (10 years ago)
Niraj - the URL link of your name to your profile page works fine on my 4.03 Android Motorola Xoom 10.1 (MZ604) - but that begs my original question. I want to utilize PDFs with pre-existing hyperlinks/bookmarks and compile them into an .apk (and eventually Xcode) while preserving the links in the finished apps. I'm not seeking to run Perl in a mobile device (cf installing Perl library in Xcode - in Resources). I need Perl installed on my Windows OS in order to run a TextLive package called "pax" and particularly this little gem - pdfannotextractor.pl "If PDF files are in­cluded us­ing pdfTEX, PDF an­no­ta­tions are stripped. The pax project of­fers a so­lu­tion with­out al­ter­ing pdfTEX. A Java pro­gram (pax.jar) parses the PDF file that will later be in­cluded. The pro­gram then writes the data of the an­no­ta­tions into a file that can be read by TEX. The LATEX pack­age pax ex­tends the graph­ics pack­age to sup­port the scheme: if a PDF file is in­cluded, the pack­age looks for the file with the an­no­ta­tion data, reads them and puts the an­no­ta­tions in the right place. Project sta­tus: ex­per­i­men­tal" http://www.ctan.org/pkg/pax This extractor is said to preserve existing hyperlink codes in a PDF in the process of compiling to an Android app. I've spend all day essentially figuring out the installations of the various LaTex and Perl related opensourceware - and I think I actually have pdfannotextractor.pl installed. Unfortunately, the process of running the extractor is involved it seems, and requires some additional configuration in order to properly write and execute a command line order. <a href="http://tex.stackexchange.com/questions/78863/how-to-install-pdfbox-on-windows-so-it-works-with-pax?lq=1" target="_blank" rel="nofollow">http://tex.stackexchange.com/questions/78863/how-to-install-pdfbox-on-windows-so-it-works-with-pax?lq=1</a> That is what I am working on currently.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
10/19/13 11:44 PM (10 years ago)
It is good to hear that the links within the Table Of Contents for that sample PDF works in your Android browser. Next step ... Have you tried to incorporate that Push Notifications PDF into a BuzzTouch app for Android? Re-test the internal pre-existing links on the Table of Contents. (I am indeed ignoring the PAX solution until I hear the above test does not work on Android) Let us know how you get along. -- Niraj
 
Maximilien_Robespi...
Aspiring developer
Profile
Posts: 45
Reg: Sep 11, 2013
Costa Mesa
4,250
like
10/23/13 01:58 PM (10 years ago)
I set up API key in Google Cloud and got as far as "push to deploy" when I encountered this: Push-to-deploy is not available for this project because it is a legacy project. To enable push-to-deploy, create a new Google Cloud project. Any suggestions? What is a legacy project?
 
Maximilien_Robespi...
Aspiring developer
Profile
Posts: 45
Reg: Sep 11, 2013
Costa Mesa
4,250
like
10/23/13 03:07 PM (10 years ago)
I found this: Cloud SQL Instances are not restricted to work only with AppEngine apps in the same project. You can just create a new project at <a href="https://cloud.google.com/console" target="_blank" rel="nofollow">https://cloud.google.com/console</a> (which will have Cloud SQL enabled), and from that project create a new Cloud SQL Database. Just make sure you replace the default authorized AppEngine project with the old one on the Create screen. share|edit edited Sep 10 at 1:24 answered Sep 9 at 20:43 Juan Enrique Muñoz Zolotoochin 992417 http://stackoverflow.com/questions/18699291/enable-cloud-sql-for-gae-legacy-project _________________ But before I "create a new project" I want to know what happens to my "old project" - the API key and SHA1 number are Eclipse project generated. Do I scrap that and start over also?
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
10/23/13 09:23 PM (10 years ago)
Watch this video for getting Android off the ground: https://www.buzztouch.com/forum/thread.php?tid=BE6CAB708EE304C98E63E2C
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.