Video embedded into pdf with Latex does not play correctly - pdf

I want to embed an mp4 video (with H.264 codec) into a pdf with Latex, using the media9 package. There are no error messages during compilation. Before activating the video in the pdf, there is a still image (as intended), but after activation, there is just a black window, without the video being played properly.
A minimal example to illustrate is given below. It is a shortened version of an Overleaf template for embedding mp4 files into pdf documents with Latex. I have attached the still image penguins.jpg to this question, but I cannot (or don't know how to) attach the video penguinschasingbutterfly.mp4 in stackoverflow.
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage{media9}
\begin{document}
This is an .mp4 file:
% using a .mp4; downloaded from https://www.youtube.com/watch?v=-9iXD2-hbJM
\includemedia[width=0.6\linewidth,height=0.6\linewidth,activate=pageopen,
passcontext,
transparent,
addresource=penguinschasingbutterfly.mp4,
flashvars={source=penguinschasingbutterfly.mp4}
]{\includegraphics[width=0.6\linewidth]{penguins}}{VPlayer.swf}
\end{document}
Before activation the pdf looks like
.
After activation the pdf looks like
The same happens also with the video files in the media9 documentation and videos embedded in other pdfs. Other multimedia files found in the media9 documentation, such as audio files and 3D objects, do work as intended.
My pdf reader is Adobe Acrobat Reader DC (20.012.20048) and I updated the Shockwave Flash plugin for my internet browser Mozilla Firefox to Shockwave Flash 32.0 r0, as the media9 documentation mentions the Adobe Flash Player plugin for Firefox among its requirements (Chapter 2).
What could be the reason for the black windows showing up and the videos not being displayed?
P.S.: If any other Latex package works well for videos within pdf files (even if outdated, like movie15 or multimedia), this would be an alternative for me.

Adobe stops Flash support by the end of 2020.
Once, somewhere in the (not so far) past, you may have given your OK to stop using Flash anymore in Acrobat Reader. You were asked this in a pop-up window while you wanted to play an embedded video. From that decision on, or from 1/1/2021 the latest, video and audio playback will depend on the media plugin of your OS, which is flaky in most cases. Plus, there won't be any means of player configuration available anymore, such as "loop", "controls", "autoplay" etc.
As Joel Geraci puts it in one of his answers in the Acrobat support forum, now, best-practice is linking videos instead of embedding them.
I am sorry for this regression :(.
Disclaimer: I am the author of the media9 LaTeX package.

This solution works for me (Adobe Acrobat Reader 2021.001.20142):
https://tex.stackexchange.com/questions/516029/media9-is-becoming-obsolete-dec-2020-any-alternatives-for-embedding-video-audio
Go to Windows Settings > Display > Graphic Settings > Under Choose an App/ Browse >
Add Acrobat.exe and edit the default from "Let Windows decide" to Power Saving Intel.
Relaunch Acrobat.
Try to play video.

Related

How can I scrape PDF created using PDF.js using selenium?

I have successfully managed to download the PDF file from a site that uses PDF.js to create and show PDFs (using selenium)
The downloaded PDF file does not open on my desktop (mac & linux).
It seems like the PDF is encoded, or encrypted.
On closer inspection, right after the PDF is downloaded, the network tab also shows pdf.js.worker. It seems like pdf.js.worker is decoding this file to show on the site.
How can I replicate, or follow the same flow of pdf.js.worker and decode this PDF?
Update
I have tried looking at the pdf.js.worker code to follow the code execution, but it seems like a really hard task, hoping there is a simpler way.

How to make semi transparent layers in PDF printable on Adobe Acrobat?

I am using an online PDF generator to generate the attached PDF.
While the PDF opens and looks OK on adobe Acrobat (I tested several different versions including Reader and Pro) the transparent layers are printed as white boxes when sent to printer (either a real printer or another PDF printer like PDFill PDF&Image Writer.
Any idea what's wrong with the transparent layers and how to fix them?
This is the file: https://dl.dropboxusercontent.com/u/18517313/flyer.pdf
There doesn't seem to be anything wrong with the file to me, and it prints apparently correctly for me when printed from Adobe Acrobat. How are you printing the file ?
One workaround would be opening the file in Acrobat Pro, and use the Flattening Preview (to be found among the Print Production Tools) to flatten the transparencies.
When you print a PDF (or any other format) from an application, several sub systems are involved. The application (such as Adobe Reader) makes calls to the graphics subsystem of the OS (such as GDI on Windows). The OS, in turn passes these calls to the printer driver which is responsible for converting these calls (such as draw line, fill path, etc.) to instructions that are understood by the printer that you selected. These instructions are referred to as the page description language or PDL. Examples of PDLs are PostScript and PCL. This abstraction is good because applications no longer need to ship their own printer drivers. The downside is that the API of the graphics subsystem and the PDL both put restrictions on the richness of your graphics.
Transparency is a typical feature that is present in PDF but only limited available in PostScript. To achieve the same visual result, the feature is approximated. In case of transparency this is called flattening as Max Wyss points out.
By the way, applications (such as Adobe Acrobat) may choose to by-pass the OS and driver and generate the PDL themselves. This is referred to as pass-through printing. Although this circumvents the limitations of the graphics subsystem, the output is still bound to the PDL of your printer.

pdf see current line ruler

I'm looking for accessibility tool , to make it easier to read pdf's.
In short, it should be possible to easily see which line is being read ( a bit like a ruler,when it comes down to text ), to avoid losing the line that is being read.
I was wondering if anyone knows any solution for this , for example a plugin for Adobe Acrobat Reader, etc...
Any suggestions are welcome.
I don't think there is a plug-in for Acrobat Reader. You may want to look at ZoomText or ClaroRead. Of course these only work if the PDF has text, but not images of text.
A low tech solution would be to open a Notepad doc and size it how you need. If you are on Win7 you could do this with sticky notes.
Another approach I've used is to convert the PDF to HTML and then run a server with it. This is fairly simple to accomplish using Live Server in VScode.
In the Chrome browser, we may then use accessibility extensions, such as ReadingBuddies, that have reading ruler functions.
Otherwise consider,
Use a PDF reader that has a built-in reading ruler feature, such as Adobe Acrobat Reader DC or Foxit Reader.
Use a PDF reader that allows you to add a reading ruler as an annotation, such as Xodo PDF Reader.
Use an online tool that allows you to view PDFs with a reading ruler, such as Smallpdf's PDF Reader.
Use a screen ruler tool, such as the one offered by How-To Geek, to measure the PDF on your screen.
The academic term is sometimes called RSVP (Rapid Serial Visual Presentation), there are patented hardware and software versions but in principle it is simply a translucent masking added to the viewport. see https://softwarerecs.stackexchange.com/questions/28582/is-there-an-equivalent-to-a-reading-guide-strip-for-windows-os-x-or-linux and http://www.see-n-read.com/products/esee-n-read-2/
10 years later and its 2023 so software such as browsers should include such features here is Edge in some sites where Immersive Reader is supported but not StackOverflow !! The above example is using an edge extension. https://microsoftedge.microsoft.com/addons/detail/screen-mask/dfanfcmhbdocjfpmnoebccndgmhlincl others are available for other browsers https://chrome.google.com/webstore/detail/reading-ruler/phiedfcbjfjagnjikfbobmldbpmdcpfk
To get the Reader Mode options on Chrome: or Edge look at the available flags
However if you save page as PDF and read aloud it is then used there !
Some PDF readers like Mac Skim include such accessibility option.
However, simplest is :-
Most PDF readers can be reduced to focus viewport on single lines and with auto scrolling that allows for more focused "line by line" reading without the audio, plus fast and easy adjustments/enlarging for PDF variable lines with illustrations.
Note as per above PDF where much of the text is actually one or two lines out of order it is not trivial for a PDF reader to understand which text base line is independently to be used next. in reality "Read Aloud" will read two variable height lines then jump to top of page then back to the second visible line. PDF lines are not the visible order nor a constant height/spacing, you might expect.

In search of a lightweight pdf viewer

I am looking for a lightweight pdf viewer ( commercial / free) for my windows application.
I presently display the pdf documents on a webbrowser with Adobe Reader Plug-ins.
Background :
The problem i am having with Adobe Reader is the Loading time. To display a pdf document for the very first time, Adobe Reader nearly takes 15 seconds !! .The application when deployed on customer locations (usually run on Windows Embedded OS) the pdf viewing time is still worse, sometimes takes more than a minute.
Hence i need to find an alternative for Adobe Reader.
My simple requirements are :
Lightweight - viewer should initialise itself and load the pdf as
fast as possible.
SVG support.
If anyone has any idea regarding such a tool. Kindly let me know
Regards
Srivatsa
Try : Foxit PDF SDK
Try SumatraPDF (Download full kit for MOZ plugin npPDFViewer.dll sorry there is NO IE.OCX)
For a minimal install use with the portable executable in same directory and you can call via DDE or command line
I think best light weight option for Windows is MuPDF for those who would rather not use any plugin in the Chrome.
http://mupdf.com/

Script to Cut Adobe Illustrator File into Tiles

I'm creating a Custom Google Map based on an image in an Adobe Illustrator file. I need to cut the file into 256px x 256px PNGs to feed into the Google Maps API.
You can write scripts to automate tasks in Illustrator using ExtendScript, a modified version of JavaScript. I found one example of a script for Photoshop that makes tiles for Google Maps (Hack #68 in this book) but I haven't figured out how to port this over to Illustrator.
The main problem is I can't figure out how to tell Illustrator to isolate 256px x 256px portions of an image. The Photoshop script does this by selecting portions of the image of that size and copying them into a new file, but as far as I know you can't do that in Illustrator.
Any ideas?
I've got no experience writing scripts for Adobe products, but since Illustrator handles vector data, the tiling algorithm is slightly different. There is a Python script for MS VisualEarth that tiles a set of GPS points (demo), maybe you can take some ideas from it.
Another choice may be to (programatically?) render .AI files to .PNG or something similar an then tile it into 256x256px tiles using that PS hack you referenced.