sayanee / angularjs-pdf

:page_facing_up: An AngularJS directive <ng-pdf> to display PDF files with PDFJS
http://sayan.ee/angularjs-pdf/
MIT License
494 stars 248 forks source link

Words of pdf are srambled #178

Closed ammar08429 closed 7 years ago

ammar08429 commented 7 years ago

when i try this PDF in pdf.js it works fine, but when i try it in angularjs-pdf, this is how i see the pdf

screen shot 2017-02-20 at 6 51 48 pm

is there anything i am missing?

dennybiasiolli commented 7 years ago

Hi @ammar08429, thanks for the issue, can you provide an example with your code and the PDF?

ammar08429 commented 7 years ago

<ng-pdf template-url="/www/app/components/pdf/viewer.html" debug="true"></ng-pdf> i generated the pdf.js and worker file, added ngPdf directive in to my own angular module and i tried multiple files , here are two below sample.pdf arabic-book.pdf

i am using Mac, chrome

dennybiasiolli commented 7 years ago

Thanks @ammar08429, on my MacOS 10.12.3, with Chrome v56, I see your two pdfs in the correct way.

Have you tried to clone this repo and put your pdf in the example folder? Then you can launch our example site with npm start and open your pdf writing its url in the textbox (pdf/lala.pdf).

In my case all works correctly.

If your error persists you can write a simple example on JSFiddle.

Thanks!

ammar08429 commented 7 years ago

Thanks @dennybiasiolli Found the problem the parent div in which i added the directive had this css direction: rtl; which was causing this problem

dennybiasiolli commented 7 years ago

Thank you @ammar08429 for the feedback