jsPDF: issue with two-page pdf within Adobe Acrobat Reader - jspdf

I am facing the issue with two-page pdf within Adobe Acrobat Reader.
I am creating 2 page pdf using jsPDF doc.fromHTML() method.
My pdf is shown properly with header and footer when opened with any browser. Al, so my printer is printing it properly
When I am opening it in adobe reader the second page is showing error while printing the pdf and even footer is also not present on the second page.
Please, can anyone help me in solving this issue?
I tried doc.addPage() but it's adding a blank page
Error Message while printing with Acrobat:
An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem

Try doc.addpage then add text to the second page using doc.text or doc.html

I was trying for days to fix that issue and found that it was causing from
setLineDashPattern
function.
I used dash patterns multiple times in my document and whenever I need to remove this global "line dash" settings from the document I was calling
doc.setLineDashPattern([0], 0);
When I debug my code line by line I found that this was the part that causes Adobe Acrobat to raise an exception. So I changed it to
doc.setLineDashPattern([], 0);
And viola!
Hope it helps someone, since I couldn't find anything about that.
Cheers

Related

Adobe Reader on iPad executing one line of javascript code

Please help, I am stuck on this weird issue.
I've some script which works perfectly on Adobe Reader (both windows & mac).
However, for some reason on iPad (in Adobe reader app), it executes only first line of code and then no response. I am sure it's not code issue, 'cos I've tried different codes and even same code like alert.
So, basically If I put following in document open script, it will alert only once.
app.alert("Image Hidden Start - 1");
app.alert("Image Hidden Start -> 2");
Also, tried putting the same code in button on PDF and same behaviour.
Please help if somebody has any idea on how to solve this issue or if I need to do this differently.
All I need to do is make document read only if an expiry date is passed and alert the user.

AxAcroPDF won't open hyperlinks

This is my very first post here, so I would like to start with Thank You. I found a lot of answers here.
I cant seem to open any link or hyperlink in pdf files with AxAcroPDF viewer? The Viewer is in a Windows Form and I use C#.
example from AxAcroPDF Viewer
Problem 1: When I click on a link nothing happens.
Problem 2: When I click on a local file link I get this security warning pops up and when accepted nothing happens?
But with Adobe Reader DC everything works just fine.
Thanks

Safari URL to PDF-page workaround?

I'm trying to link from an URL to a specific page within a PDF document being viewed using the Preview.app built in Safari (using iOS on iPad2).
I know that Sarafi does not support (hopefully in the near future) the PDF parameters like for example:
www.mywebsite.com/information.pdf#page17
or
www.mywebsite.com/information.pdf#page=17
Which should result in the PDF being viewed on page 17 when opened.
But as we know Safari opens it at the first page instead.
However!
When I am displaying the PDF in Safari and I change the pagenumber (in the URL bar) into a different pagenumber, IT WORKS.
It jumps to the correct page, and I'm changing it again and again and it works flawlessly.
So I figured, alright maybe it's because the PDF needs to be loaded the first time viewing, so I preloaded the PDF in cache, but no succes.
How can I get it to work, so that it goes to the correct page when opening the PDF?
Is there a script for changing the page number after loading or is there a different solution?
You can find the PDF I'm talking about here:
http://www.michaelmaasdam.nl/mobile/new/pagina/begroting/begroting2012.pdf?page=14
Is this link being shown from a native app?
If so, you could opt to use QuickLook instead and you may have a little more control over this kind of thing from within that.

An iframe tab code that was working now shows a blank screen

I'm making some fanpages.
I have a code that show an image to the user before liking the page, and another image or content after liking the page.
I created several pages with this code and all of them worked fine.
but about 5 days ago, I created one with the same code, and it just showed the "after like" content, even when I haven't liked the page.
and today, I created a new one, and it just shows a blank page. neither the after or the before.
I've checked on the previous fanpages and those are still working, so it's just the new pages that aren't working.
they'r using the facebook php sdk
the procedure I use is:
* upload files to my server
* create a new app
* add urls for page tab (both normal and secure url)
* add app to my page
is someone having the same issue?
does someone know why is that problem and how it can be solved?
thanks,
Abraham
if you have php errors turned off, and you throw a fatal php error before any html output, you might also see a blank screen.
Try uploading a dummy file with some simple text as your main app page, and see if it works.
If so, try tracking down any error that might prevent the page from rendering.
To get output on php errors, add this to the top of your page:
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
?>

How to fix "error exists on this page" PDF error from prawn generated documents?

I'm generating PDFs in my Rails application using the Prawn PDF library. Everything is working great, but when opening the resulting PDF in Acrobat or Acrobat Reader the message below is shown:
An error exists on this page. Acrobat
may not display the page correctly.
Please contact the person who created
the PDF document to correct the
problem.
Adobe lists this as being fixed in their Acrobat 8.1.3 release notes.
1810668 Memory leak while printing
large document with images:

> When a large document is exported to a
PostScript, or sent to a printer for
printing "An error exists on this
page. Acrobat may not display the page
correctly. Please contact the person
who created the PDF document to
correct the problem" can occur. This
problem was encountered on certain
documents with a large number of
monochrome images, but has been
rectified in 8.1.3.Root: Fixes issue
found in 8.1.2.
But I'm seeing the issue in all current Versions of Acrobat Professional and Acrobat reader. My PDF does use a background image on every page, has lots of pages (usually 75+), and has lots of transparent images, but nothing that should be causing an error. Additionally Mac's Preview shows no issues, and if you press "OK" on the Acrobat error, everything is fine.
I ran the Preflight tool in Acrobat Professional to check for PDF syntax errors and found no errors but some warnings "Unbalanced q and Q operators".
This is for a customer facing application so I can't change settings to suppress the error in the PDF reader.
Any ideas on how I can get the error to go away?
As Mark noted "q" and "Q" operators must be balanced in a pdf file.
Prawn PDF library seems to have a bug. I found this in a comment of an open issue:
I made an workaround some weeks ago by
patching the prawn-library itself. The
root of this error is an "unbalanced
q/Q", which appears only in Adobe
Acrobat Pro preflight. I patched it by
adding an additional \q in the prawn
PDF-Generator.
https://github.com/sandal/prawn-layout/issues#issue/25
This was a bug in prawn, it should be fixed in the 0.11.1 release.

Resources