I am developing Rails 4 application where used PDF:Toolkit. Everything work file like open pdf, pdf-to-text working well in local.
But when i uploaded code on server then always read any pdf blank. No any contents read inside PDF file.
PDF::Toolkit.pdftotext(#document.attachment.path,"-layout")
Output nil of every PDF using above syntax.
I tried lots but not found any issue.
Anyone have a idea.
Related
I'm migrating from PHP 5+ to PHP 7+ on standard app engine.
To upload file, I'm making a POST request to an internal endpoint with all form data (text and file to upload).
Actually what I was doing on v5 to let this work:
Get the URL with CloudStorageTools::createUploadUrl
POST everything to the url returned from the step before
In this way, all posted form (text and file to upload) was posted correctly to my internal endpoint and file can be uploaded on google storage.
Migrating to php 7+ CloudStorageTools::createUploadUrl can't be used.
Direcly upload working fine, if file is not so bigger.
For bigger file I haven't still found a solution, a lot of people have this problem but seems no one actually solved it.
There is some workaround or some tips to solve it?
I've already tested different methods got from here: https://googleapis.github.io/google-cloud-php/#/docs/cloud-storage/v1.23.2/storage/readme
No one is actually working (I got URL where upload, but at the end of upload everything crash).
Google documentation about that is not so clear, they say you can't use the older library, but actually online I can find always the same basically code that it's not good for larger file.
I have a Ruby on Rails back-end service that takes individual PDF documents and combines them into a consolidated PDF - app uses Wicked-PDF ruby gem for generation.
When the PDF is viewed through the browser's default document viewer for PDF, the full document is visible. However, when the document is downloaded and viewed through Adobe Reader or Acrobat, only a part of the document will be fully rendered and then I receive an error "Problem reading this document (14)" with all of the remaining pages turning into small blank thumbnail-like pages, almost like it is corrupted - however, it is not corrupted because it is fully viewable in the browser.
The error has occurred on multiple documents in inconsistent locations, so it seems like it might be related to the particular document being compiled into the full PDF document, but haven't been able to isolate the cause.
Has anyone else encountered this issue w/ the Wicked-PDF package gem?
We identified that the issue was actually in the combine_pdf gem we were using to do the document compilation. The error is caused when two or more documents share the exact same content, ie. they are the same file, regardless of their file name. We are now commparing each document to all others before compilation to ensure that it will not generate an error.
I'm trying to display a .pdf file on a browserfield but somehow it's not opening in my app however it works fine with .txt files.
I'm reading .pdf file from local storage and using
browser_field.displayContent(fileinbytes, "application/pdf", "");
but it's displaying a player like image on the screen and not actual result.
If anyone has any idea about the same, i'm all ears.
As far as I can tell this isn't possible (browserfield doesn't even fully support javascript).
This post suggests that you can view it via Google, which wouldn't be from local storage.
(Un)luckily blackberry is very similar to Java ME, so you can often use those libraries as is. Apparently JPedal can render pdf files for J2ME, and might be worth a look.
Other than that, I don't think you'll have much hope. Good luck
I will try to explain my problem : I have a rails application which, for the moment, shows the files which are present in my public directory (there are only txt files). I would like to transform my txt files into html files using asciidoc command when I click on a button in my application (or automatically when I add a txt file in the directory) but I don’t know how to do that.
Thanks in advance.
I don't see this as being closed so...
The best way to go about this is to use asciidoctor, the ruby implementation of asciidoc. It is used in github and it plays quite well with rails.
To read all the files with .asciidoc extension you can google and find many useful answers, such as the one you pointed out in your comment.
I have a site that saves user documents and I want to use Paperclip to display them using Google Docs Viewer (https://drive.googleblog.com/2009/09/view-online-files-using-google-docs.html).
Paperclip is working. For instance, I have a file saved at:
127.0.0.1:3000/assets/resumes/51/original/myfile.pdf
I want to display that through the viewer embedded in my site. This is my code (in HAML):
%iframe{:src=>"http://docs.google.com/viewer?url=http%3A%2F%2F127.0.0.1:3000/#{#user.file.url}&embedded=true"}
Is the problem just the fact that I haven't got the site up and running on a public server yet, or is something wrong with my code? (When I paste the url straight into my browser without the viewer stuff I do see the file.)
Your assumption is correct. It is not working because your application is not in a public environment and Google Docs has no way of accessing your PDFs through your localhost address.