I am using ti.jspdf to create a stock order form. When adding an image i use
PDF.addImage(Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'logo/logo-pdf.jpg').nativePath,'JPEG',10,13,60,14);
this works fine until i try to open the pdf on anything other than an iPhone.
if i take out the image the pdf opens fine on everything. I have tried to base64 it as a large string but the port of jspdf to ti.jspdf seems to only support a file path being passed through to it.
has anyone seen / overcome this issue?
Thanks
Related
We are running TinyMCE version 5.4.1 with various options including:
paste_data_images: true
powerpaste_allow_local_image: true
When we drag & drop (or paste) in smaller images (400px X 400px) everything seems to work fine. The Base64 encoding is saved to the database and the image is rendered from all browsers, Chrome, Firefox and Safari.
However, when we paste in a larger image (1920px x 1081px) the image is only saved and rendered correctly in Chrome and Firefox. In Safari the Base64 encoding is saved with all lowercase characters. Therefore it doesn't render when attempting to view it. Has anyone else experienced this?
I have searched here as well as on the TinyMCE website but don't see anything mentioning this behavior. We will eventually attempt to move away from this Base64 implementation as it's no longer recommended but it's what we have for the time being so I'm just trying to address this issue.
When the page loads, its' elements can do so in parallel. But when the browser sees the base64 image, it blocks the page from loading until this image is rendered. Thus, inserting large images into the page as base64 is certainly not a good practice - it may slow down page loads and worsen the UX.
To fix this problem and maybe several other issues, utilizing the automatic_uploads option is highly recommended. It will upload pasted images on the server instead of converting them to base64. Here is the example of the PHP upload handler that will upload images and give their URLs back to TinyMCE.
Concerning the issue with Safari, some minimal reproducible example would be very useful.
I should also mention that PowerPaste is a premium feature that will not work with TinyMCE opensource. If you are using the paid version of TinyMCE, you can create a support ticket.
I have a webform with and want to open it on smartphone - than take pictures of some documents which need to be merged in one PDF, and on the end this file need to be uploaded to server.
My solution is to use Google Drive to upload PDF (scan) to GDrive and then somehow download this file from gdrive to server via some sort of widget (any links appreciate) installed on website.
Maybe someone have a better idea?
I know its late but my answer might help others. I also face the same challenge and implemented a custom solution based on Javascript and Since you are using web form so this solution will perfectly fits on your need.
You have to use JSPdf javascript library, JSPdf provide you pdf object in your browser and you can upload it download it and there are many other thing to play with.
First you have to initialize JSPdf object as per your requirement. I am creating PDF with page size width:500px and height 500px.
pdf = new jsPDF("l", "pt", [500,500]);
Simply when you will take picture from camera you will have each picture in form of base64, that base64 format you have to insert in JSPdf object
pdf.addImage(imgData, 'JPEG', 0, 0);
you can repeat the above code to add pictures from camera as much as you want, at the back-end these images are compiling and creating pdf document where each page have each images in sequence.
Once you are done, you can get PDF object in form of base64 object using below code that you can upload to any server.
pdf.output('datauristring')
above is only pdf part, you can find complete working example including camera part here Javascript Component to Scan Document
I want to Showing PDF inside iframe for user preview before download the file or print,
i use byte array convert my report file to pdf then showing it.
everything was perfect until i need something in ssl/https.
because of that i must change my application to ssl/https can some one show me how can i show pdf in this condition.
thanks for listening and reading my prob.
here my code
reportDocument.Load(reportPath);
reportDocument.SetDataSource(dataSet);
_contentBytes = StreamToBytes(reportDocument.ExportToStream(ExportFormatType.PortableDocFormat));
.....
//setting header
.....
//then flush
stream.Flush();
i found the solution in
PDF conversion suddenly fails if reading stylesheet from SSL
the problem is the pdf reader inside my chrome browser.
so i updating my chrome reader in store search pdf viewer..
just it..
I built in vb.net one webserver from this how-to: http://www.java2s.com/Tutorial/VB/0400__Socket-Network/TcpListenerbasedWebserver.htm
The code works fine reads the html but I can not understand why not showing images. Any suggestion?
Downloading the HTML of a webpage will absolutely never download any kind of secondary elements/files, including images.
In order to get the images, you'll need to get the images URL and download them separately.
I replaced the original images with my own images in the simple-slider-source.html file in the non-jquery example folder and uploaded into the server along with the image folder and .js files but it doesn't work. It just running the slider without the images. Before uploading into my server, I have compiled it with the simple-slider.compress batch file. In case of original images it's working fine but not with the replaced images.
Is there anybody who can suggest any clue why it is happening and how to fix it? Providing sourcecode snippet would be much appreciated.
The src attribute (url) of the <img> element is incorrect.