Broken image after exporting Datastudio into pdf - image

We are using a combination of supermetrics, google sheets and datastudio for reporting social media content results. Supermetrics provide us with "Post image URL", for example this one: imageURL. The next step us using image+importrange function in different spreadsheet:
=IMAGE(IMPORTRANGE("XXXXXXXXXXXXXXXXXXXXXXXXXXXXX","'XXXXXXXXXXXXXXXX'!O2")).
This loads an image usually without any problem (apart from sometimes when the image simply doesn't load, god knows why):
Final step is using "Publish to the web" function in spreadsheets and then URL embed function in Datastudio - result is okay with pictures fully loading, however after exporting the data studio report into pdf (only way to download it), the images appear broken. All spreadsheets have sufficient rights and this is happening even if the base spreadsheet is set as public (+ results numbers are okay even in the pdf, so this should be the reason).

Okay so I have no idea why, when or how, but exporting to pdf works with images included today.

Related

pdf importer with maroto

I am trying to develop a pdf generator. The pdf generator has multiple page. First page has some specific value with is working fine. But the second page has invoice which user uploads, In this case the user can upload a image file or pdf file.
For this I am using maroto library which works great when it comes to image or content generation but there is no support for import another pdf and merge with current one.
Now i know maroto uses gofpdf library and gofpdf has pdi importer so in my mind it should be possible to implement such feature. I didn't get any reply from their git issue board so asking it here.
Can anyone help me with this?? or my only choice is to change the library and do the coding again?
I could not find a solution for this. So i had to improvise the system
the way I solved the problem is:
generate a pdf using marotopdf library
load the second pdf
use unidoc library and merge 2 pdfs (its just merging 2 pdfs 1 after another)
This is not solving my problem 100% as i would like to have the ability to add company logo on the second pdf which is not editable atm. But its dining the main work (merge 2 pdf).
I've created a simple library to help you with this. It adds two methods to the gofpdf Fpdf class:
importPdf imports a PDF into the current PDF document
linkPdf creates a hyperlink to a PDF document
It uses cgo to use the pdsys, pdflib and pdflib_pllibraries.
You can find it here: https://github.com/jung-kurt/gofpdf

Publish Excel sheet to SharePoint with linked images

I have an Excel workbook with a bunch of Sheets, that I would like to publish to different SharePoint sub-sites within a sites hierarchy.
I have written a VBA procedure that does that, but unfortunately it does not work correctly, because the sheets have images and Excel tries to copy them by creating the "*_files" structure, which I DO NOT WANT! The images are already on the server, and I would only need Excel to use their URLs and everything would by fine with just creating the plain HTML without any "*_files" folder.
If I keep it like that, Excel tries to generate the PNGs for the files but failes for some reason and they come out 0B long. It works fine for local paths or even different server paths, so I don't know the reason.
Anyone has an idea?
EDIT:
It seems that setting ActiveWorkbook.WebOptions.OrganizeInFolder = False solves ar least the problem with displaying the images. Excel keeps copying the images, generating useless clutter, but at least the rendering is ok...
Do also remember to set ActiveWorkbook.WebOptions.RelyOnVML= False, otherwise the page will not work outside IE.

Why pdftk produced pdf files will not render in Firefox?

I have a site - www.jcrocetta.com.
On this site I have 2 pdf files. One file has blurred data and the other is clear, both files were created with pdftk.
In order to blur out some personal data in the pdf I used Inkscape. But Inkscape only opens/edits one PDF page at a time. After I made my edits in Inkscape I saved the files as .pdf formatted files. At that point I had three separate pdf files, pages 1 through 3. I then used pdftk to concatenate the 3 files into one.
The final pdftk-produced files are on www.jcrocetta.com. Just click the public information button.
In Chrome viewing inline works fine.
Downloading the file from Firefox works fine too.
But viewing inline on Firefox it renders blank pages. How can I fix this?
Also, I know that pdf files not produced with pdftk will render correctly on both Chrome and Firefox.
Thanks for your help.
FireFox has a lovely new feature: It now uses the PDF.js library to render PDF files, instead of calling out to an Adobe Reader plugin, or forcing you to save the file to disk. Unfortunately, it seem that PDF.js isn't quite perfect yet. A quick search shows that other people have the same issue, but the only "solution" I've seen offered boils down to "file a bug report at https://github.com/mozilla/pdf.js/issues or https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox&component=PDF+Viewer".
Also: Do the three individual PDF files render in FireFox, before you use pdftk to concatenate them?

Displaying a map in Quicklook preview

I'm writing a Quicklook generator plugin for a GPS logging file format (.fit files). I've shoved something together which loads the file and plots the path using the NSGraphics/NSBezier stuff:
(the horrible code for the above can be found here)
This is fine, but it would be much nicer to display this over Google Maps data or similar (the recorded tracks cover a fairly small distance - e.g the above covers about 20km by 10km - too small to display on a single map of the earth, so the map needs to be dynamically loaded somehow)
Things I've tried so far:
Returning HTML which shows a Javascript GMap instance. Doesn't work as the Quicklook HTML rendering doesn't allow Javascript (or Flash, Java etc)
Returning HTML containing a static Google Maps image. Quicklook wont load remote images.
Getting a NSGraphicsContext and displaying a standard WebKitView into this, modified from some thumbnailing code - this errors because you cannot initialise WebKit from a secondary thread (which seems to work fine for thumbnails, but not previews?)
With 2. I could possibly download the static Google Map image in ObjC, then display that with HTML, but the static map isn't ideal (fixed size so no zooming, and potentially slow to initially load)
I came across MacMapKit which I've not tried yet, but since it's WebKit based, I suspect it will have the same issue as 3.
Is there some way of displaying a map in a Quicklook that I am overlooking?
trying to get Google data directly in your generator (whatever way you try to do it) is not possible as the host of your plug-in is sandboxed and denies any connection to the network
trying to return HTML data and some clever javascript won't work either as the Quick Look panel also protects against network access for security reason and there is no public way to work that around
I am afraid you won't find a real solution to your problem, except by using your own map data.
Still, your use case is interesting and you should file a bug to Apple's Bug Report website.

Ruby pdf testing in browser

Has anyone been able to find a way to test pdf's with ruby within the browser? I have tried a few different ways and the only way I have been able to get any pdf testing to work is to save off the pdf and use the pdf_reader gem. This only seems to work on pdf's that, when the link is clicked, opens up a dialog box with the options to open or save the pdf. Unfortunately I have not been able to find a way to do anything like this with pdf's that are opened in browser, with no dialog box options to save it. Any ideas?
Maybe testing it in the browser isnt the best way. When you say test the pdf what are you trying to do? I wouldnt test the pdf in the browser if I was you.
Try docsplit, if you want to verify its contents.
Docsplit is a command-line utility and Ruby library for splitting apart documents into their component parts: searchable UTF-8 plain text via OCR if necessary, page images or thumbnails in any format, PDFs, single pages, and document metadata (title, author, number of pages...)
You are not inventing a browser, or a PDF generator.
Use unit tests to check your back-end modules can take data in, and write PDF out, then serve the PDF in a website and let the browser do its thing. Test (as what Rails calls a "functional test") that the MVC will produce a web page containing a link to the PDF, and you are done.
You can use gem 'mechanize' to download an online PDF (the PDF with in a browser) on your computer and then read it via gem PDF reader.

Resources