Log of #mupdf at irc.freenode.net.

Search:
 <<<Back 1 day (to 2017/12/18)20171219 
Diemex Howdy19:37.45 
mubot Welcome to #mupdf, the channel for MuPDF. If you have a question, please ask it, don't ask to ask it. Do be prepared to wait for a reply as devs will check the logs and reply when they come on line.19:37.45 
Diemex I'm trying to compile mupdf for android. Tried the mini and nui repos.19:39.39 
  There must be something wrong with the include paths. I'm getting this:19:39.59 
  [mips64] Compile : mupdf_core <= bidi.c In file included from /home/diemex/CODE/mupdf-android-viewer-mini/jni/libmupdf/platform/java/mupdf_native.c:10: /home/diemex/CODE/mupdf-android-viewer-mini/jni/libmupdf/include/mupdf/pdf.h:10:10: fatal error: 'mupdf/pdf/name-table.h' file not found #include "mupdf/pdf/name-table.h" ^~~~~~~~~~~~~~~~~~~~~~~~ [mips64] Compile : mupdf_core <= bidi-std.c19:40.03 
  Hmm beautiful formatting19:40.33 
malc_ Diemex: not sure what your problem is but nevertheless name-table.h is an auto-generated file, have you built libmupdf yet?20:06.22 
sebras Diemex: with the mini repo you should be able to run e.g. "./gradlew assemble" to build bot the debug and release builds of MuPDF Mini (the .apk files should all be under app/build/outputs/apk/).20:13.01 
  Diemex: the app/build.gradle file should be pointing to 1.11.1 so you wouldn't need to clone libmupdf on your own. by default it should grab 1.11.1 of libmupdf from our maven repository.20:13.58 
  Diemex: it sounds like you have not run "make generate" in the libmupdf directory.20:15.38 
Diemex I have run git clone --recursive to get the repo20:15.50 
  then gradlew assembleRelease20:16.03 
sebras Diemex: how and where to run "make generate" is mentioned in the README at top-level directory.20:16.13 
  Diemex: look for the heading "Building the JNI library locally".20:16.35 
Diemex Ah okay. make generate was the missing step. Is the -nui repo outdated?20:22.50 
sebras Diemex: it is.20:23.08 
  -mini and this one git://git.ghostscript.com/mupdf-android-viewer.git those are the most up to date ones.20:23.55 
  though I notice that we have forgotten to update both of those to version 1.12.0 which we released recently.20:24.46 
  hrm... I wonder if there's a reason for that...20:24.56 
Diemex Is there a repo that I include as a git submodule so I can use the library in my App?20:26.01 
sebras Diemex: I believe that should be documented here: https://mupdf.com/docs/android-sdk.html20:28.07 
Diemex Oh, I cannot use Google Play Services.20:31.11 
sebras Diemex: you can, but you must first aquire a commercial license for mupdf.20:32.29 
  Diemex: parts like AdMob are problematic in that they do not release the source code for their library, so that would make it impossible for you to comply with the AGPLv3 license where you need to distribute the complete source code of your app and all the libraries you link with.20:34.03 
Diemex My app doesn't need to be AGPL though? Just Open Source?20:35.36 
sebras Diemex: what do you mean by Open Source?20:35.56 
Diemex GPL or something else20:36.25 
sebras Diemex: according to the terms of AGPL you may include source code and link with libraries that are of other licenses, but the combined work (i.e. the resulting .apk) must still be distributed under the AGPLv3. if the license of one of the source code files or libraries prevents this then you can not adhere to AGPLv3.20:37.21 
Diemex Okay. I'm not that knowledgeable about licenses. But I can change the license of the Code I have written myself later on. Right?20:38.25 
sebras Diemex: yeah, so if you license all the source code _you_ wrote but include AdMob, then the resulting .apk still needs to be released under AGPLv3 and that includes all libraries you link with, such as AdMob.20:38.25 
Diemex I don't think I need Admob. But I want to use Google Drive. I'm not sure if that is included in Google Play Services20:39.30 
sebras Diemex: you are allowed to release your own code under whatever license you want to, yes. and you may change the license at a later stage.20:39.32 
  Diemex: if you want to use Google Drive you must determine what license it is released under before linking with it. so that you know that you can do so legally.20:40.23 
  Diemex: I appreciate that you ask about this, btw! many android developers are quite unknowledgeable about licenses and believe that they don't matter. but they do.20:41.05 
Diemex Hmpf. Google Drive API is part of Google Play Services. I will have to look for an open source implementation then. Or simply not release my app.20:44.44 
sebras Diemex: if decide you still want to release it you can inquire over at sales@artifex.com for a commercial license.20:45.29 
Diemex It is a side project in anyways. I just want a simple/fast Android App to take notes with my tablet for university.20:45.34 
  I have already determined that it is going to be a loss. Niche App and tablets are all Windows nowadays.20:46.15 
sebras Diemex: aha, well, if it is only for your personal use you can of course link it with whatever you want. the problems appera when you start distributing the app to others.20:46.48 
Diemex It is going to be a while until it's going to be in a state in which other would want to use it20:47.22 
sebras Diemex: are tablets mostly windows-based today? ouch, I didn't know that. :-/20:47.25 
  Diemex: so as I understand it the main driver for you wanting to do this is that the annotation support in the existing mupdf app is not sufficient for what you want to do?20:48.14 
Diemex Yeah. Most tablets that have an inductive pen are Windows. It is really hard to find a decent 12 inch Android tablet with a real pen.20:48.16 
sebras Diemex: annotations is something we're looking into at the moment, but the work is not finished yet.20:48.55 
Diemex I have a Galaxy Note Pro 12.2 and Samsung hasn't released a successor in 2 yeras20:48.59 
  I don't use MuPdf for annotations20:49.10 
  I use LectureNotes. That is the only App in which I can use my finger to scroll and the pen solely for annotations.20:49.39 
  Also MuPdf doesn't have continuous scrolling20:50.03 
sebras Diemex: ah, so you want to have the lecture notes separate from the PDF. some people want it _inside_ the PDF itself. hard to know your preferred use case. :)20:50.52 
Diemex Atm I use LectureNotes. It uses MuPdf to convert a PDF into pictures. Once it has the folder of pictures it imports it. Then by supporting multiple layers of bitmaps you can have the rendered PDF in the bottom most layer and write on top of it. It works well and the freedom of working with bitmaps makes editing easy. However once the pdf has been imported into LectureNotes it is GONE. You cannot really get the notes back into the PDF.20:53.55 
  Now that I think of it I could potentially write a Script/App and just use MuPdf to merge the changes back into the PDF.20:54.57 
sebras Diemex: right, would you want to be able to have the ink annotations (basically free form paths drawn by the stylus) inside the PDF though?20:55.29 
  Diemex: as real PDF annotations which can be viewed (and possibly edited) in other PDF viewers too?20:55.51 
Diemex Ideally I would have free form variable width paths in the PDF that can be at least viewed in other PDF viewers.20:56.38 
  As far as I know PDF only has constant width paths20:56.51 
  But as a start constant width would be much better than my current Bitmap/pcitures setup20:57.16 
sebras Diemex: we do have an ink annotation support to some extent in our old app over at: https://play.google.com/store/apps/details?id=com.artifex.mupdfdemo20:57.29 
  Diemex: re: variable width: you might be right. that would probably interfere with pressure sensitive styluses.20:58.02 
Diemex Many PDF viewers have support for adding ink annotations. But they all suck as they dont natively support styluses20:58.32 
  I don't want to press a button or go through any menu to be able to add annotations20:59.12 
sebras Diemex: ok, that's interesting. I didn't know that you wouldn't get stylus support automagically when having support for doing ink annotations using your finger.20:59.37 
  Diemex: right, I see.20:59.50 
Diemex The app needs to distinguish between the finger and the pen21:00.13 
  There is an Android API for it. I believe it was added in Android 5.021:00.31 
sebras 6.0, I just found the docs. :)21:00.44 
  seems like android supports getting things like stylus pressure, but PDF doesn't seem to support drawing variable width strokes.21:02.27 
  that's a bit of a fail.21:03.11 
Diemex The ability to distinguish between stylus and fingers was added in API 1421:03.38 
  Later things like tilt were added. My tablet doesn't support tilt information anyways21:04.06 
  Even Android Canvas doesn't support variable width strokes. It requires custom rendering. I have already implemented that 2 years ago haha21:04.52 
sebras since we plan to redo the annotation interface, this is something we should probably take into account.21:05.09 
  but yeah, tilt and pressure is probably something that we never will be able to support well. :-/21:05.39 
Diemex Tbh that is not needed. The pressure is much more important21:06.06 
  You wont be doing Picasso artworks in PDFs. Tilt is more for drawing21:06.27 
sebras naturally, but if PDF can't represent the variable width, then we can not store the information is a standardized way so that all viewers show the document similarly.21:07.26 
  I'm suprised that this has not been adressed even in PDF 2.0.21:07.47 
Diemex The way I was thinking of supporting this was saving the data from the Pen in a "raw" format in a separate file/archive/folder alongside the PDF. Then at the beginning just writing the data as constant width strokes to the PDF. Then later on rendering the strokes in a higher resolution to the PDF.21:10.45 
  I haven't really looked into export into PDF. Naively I would compose the variable width strokes of multiple strokes with different width layered on top of one another.21:11.41 
  This is how I did it on Android.21:11.49 
  But I haven't tested the performance of this in a PDF.21:12.06 
  Generally I am not closely familiar with annotations in PDFs21:12.33 
  Vector graphics are not that simple. If you want the strokes to look somewhat decent they need to filtered and smoothed. They cannot be written directly to the PDF as strokes. A user can hold the pen on the screen at one location and the Android system will contiuously generate MotionEvents. Then you have hundreds of points for a single stroke when only 3-5 would have been accurate enough.21:15.23 
sebras Diemex: the PDF format has support for several kinds of annotations: like icons that you can click and have a box of text be shown, or underlines/highlights/whatever that you can click and get a textbox where you type in text (like when reviewing a document), and also ink annotations.21:15.41 
  all of these are objects inside the PDF document file itself. nothing external. this also means that how they work is specificed in the PDF specification.21:16.17 
  yes, in the old android viewer that I linked to a while ago we do support finger-based ink annotations. of course they are not variable width, nor would a stylus work.21:17.25 
Diemex This is actually a project that I have wanted to complete since 2 years lol21:18.33 
  I have many parts somewhat programmed already21:18.46 
  I actually have a tiled contiuous scrolling renderer. I also have a vectorsgraphics part with undo/redo, eraser and select tool21:19.31 
sebras perhaps it can be done using some kind of annotation appearance stream. hm.21:20.10 
Diemex Whats that21:20.26 
malc_ Diemex: what's "tiled contiuous scrolling renderer"?21:21.09 
Diemex A tiled renderer that divides pages into tiles and then renders the tiles. Continuous as in continuous scrolling support which means multiple pages at once.21:22.26 
sebras Diemex: appearance streams specify how the annotation should be drawn visually. if they are not present the visual representation may be synthesized by the viewer.21:24.11 
  Diemex: so an ink annotation has e.g. a list of the points on the page between which lines or curves should be drawn. and a global width and color for the entire annotation.21:25.00 
  Diemex: but if the ink annotation also specified an appearance stream perhaps the color and width wouldn't have to be global for the entire annotation, but could be vary along its path.21:26.03 
malc_ Diemex: okay, i do that too21:26.17 
Diemex malc_: What is your App?21:29.38 
sebras Diemex: http://www.pdfill.com/example/pdf_ink_new.pdf this pdf looks like it contains variable width annotations, but in reality everything in red and blue is simply an image superimposed on the PDF.21:30.36 
  Diemex: that means that if two annotations overlap it would be hard to remove them independently e.g.21:31.00 
Diemex Can strokes be grouped in a PDF?21:32.18 
  For my use-case it wouldn't really matter if the strokes can be edited easily by another editor. I won't be editing the annotations in the PDFs. PDF would only be an export format.21:33.29 
malc_ Diemex: it's not a mobile application, just your bog standard x11/macos program21:33.31 
Diemex malc_: But still cool if it works21:34.24 
malc_ Diemex: it does, for instance https://www.youtube.com/watch?v=Pdf-RtDDpaw21:35.03 
sebras Diemex: I'm thinking of PDF as being the editable format.21:35.18 
malc_ sebras: that pdf results in "warning: unknown link uri 'http://www.pdfill.com''"21:35.27 
sebras I know.21:35.36 
  I don't know why yet. :)21:35.46 
malc_ sebras: lovely pdf, one page and 2 outline entries :)21:36.15 
sebras so there is.21:37.48 
Diemex If PDF is the editable Format things become much more complex. I was thinking of having a PDF as the starting point. The notes in a custom format and a resulting PDF.21:38.15 
sebras Diemex: I think they can be grouped, yes.21:38.44 
Diemex malc_: Nice! Seems to have lots of keyboard shortcuts.21:38.57 
sebras Diemex: well, this much more complex case is what we are targeting for the mupdf viewer. :)21:39.11 
malc_ Diemex: i have severe rodent allergies21:39.30 
Diemex malc_: Sorry to hear about that, viewer is cool21:42.02 
  Anyhow, was an informative chat. I have a MuPDF binary now. Need to do some planning and see how it goes21:42.45 
  Cheerio21:42.54 
sebras Diemex: you're welcome. thank you for explaining stylus usage a bit. :)21:43.24 
 Forward 1 day (to 2017/12/20)>>> 
ghostscript.com #ghostscript
Search: