uttampanchasara / pdf-generator Goto Github PK
View Code? Open in Web Editor NEWPDF Generator library, easy way to create PDF from String Content or Any HTML Content.
PDF Generator library, easy way to create PDF from String Content or Any HTML Content.
Hi @UttamPanchasara , fyi this library is not working in Android SDK 33 since they have a new permissions.
what about creating table with specified rows and columns
for example to generate an Invoice you need a table to put items or what ever in it
@UttamPanchasara , Hope you doing well!
I am getting the same error despite adding android:requestLegacyExternalStorage="true" .
Running it on older device - Android 8.1.0
/PdfPrint: Failed to open ParcelFileDescriptor
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively0(Native Method)
at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java:281)
at java.io.File.createNewFile(File.java:1000)
at android.print.PdfPrint.getOutputFile(PdfPrint.java:45)
at android.print.PdfPrint.access$000(PdfPrint.java:9)
at android.print.PdfPrint$1.onLayoutFinished(PdfPrint.java:21)
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.pdfmybills, PID: 30165
java.lang.IllegalArgumentException: fd cannot be null
at Ny0.onWrite(chromium-Monochrome.aab-stable-414708973:28)
at android.print.PdfPrint$1.onLayoutFinished(PdfPrint.java:21)
at Ny0.onLayout(chromium-Monochrome.aab-stable-414708973:4)
at android.print.PdfPrint.print(PdfPrint.java:18)
at com.uttampanchasara.pdfgenerator.CreatePdf.savePdf(CreatePdf.kt:129)
at com.uttampanchasara.pdfgenerator.CreatePdf.access$savePdf(CreatePdf.kt:19)
at com.uttampanchasara.pdfgenerator.CreatePdf$create$1.onPageFinished(CreatePdf.kt:102)
at oo.b(chromium-Monochrome.aab-stable-414708973:2)
at ky0.handleMessage(chromium-Monochrome.aab-stable-414708973:66)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6635)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
I cant add some Custom Paragraphs separately and I cant set RTL or LTR support for each Paragraph
creating large PDF it's take much time.
It's easy to use on Android. Does it support IOS platform?
E/UncaughtException: java.lang.IllegalStateException: printing is already pending
at org.chromium.android_webview.AwPdfExporter.a(PG:8)
at aCD.onWrite(PG:29)
at android.print.PrintManager$PrintDocumentAdapterDelegate$MyHandler.handleMessage(PrintManager.java:1055)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:203)
at android.app.ActivityThread.main(ActivityThread.java:6251)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1075)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Hello @UttamPanchasara, thank you for this beautiful library, it's saving me so much time.
When I try to generate a pdf, using .openPrintDialog(true), and try saving the pdf in the internal memory of my phone, the file will be saved as "namefile.pdf.pdf".
I checked the .setPdfName() and I don't pass any string that ends with ".pdf".
Could this line be the problem?
Thank you for your time.
Hi - The image is not loaded in pdf file if the target sdk version is 30. The allowFileAccess is set to false by default 30 and above and we manually need to set it to true. Can you please update the same in your library.
we can't able to alignment the paragraph
Hi, this library works really well no problems at all..As you already mentioned that content can be string or HTML, right. So, I am little confused about the HTML part, is it supported ? If it is, what's the way to convert HTML content to pdf.
Regards..
How to use this library in java code. it is very good library but i need in java. please give me solution. coz its need java compatibility.
Is it possible to pass the location where I need to download the file?
Hello, I've used this library and it works fine but issue is that I want to print 75mm and it makes pdf in A4 size only.
Hello
How i can save image in pdf file ?
Hello,
the library while creating pdf change my css page html...
I don't know why ?
implementation 'com.uttampanchasara.pdfgenerator:pdfgenerator:1.3' doesn't work
Hello Uttam
I am very glad to use your library for PDF generation. i want one more minor enhancement in library.
when we click on button for PDF generation. need to show some processing with progressDialogBar. when library work we don't have any access to show progress bar or other, because that time your code work in background thread, please check.
Thanks again
Converted PDF file saved with only one blank page, it is happening with some files. I am attaching one file, please check
like bootstrap.
I hope you are doing great!!
Fatal Exception: java.lang.IllegalArgumentException
fd cannot be null
Fatal Exception: java.lang.IllegalArgumentException: fd cannot be null
at dp.onWrite(dp.java:27)
at android.print.PdfPrint$1.onLayoutFinished(PdfPrint.java:30)
at dp.onLayout(dp.java:4)
at android.print.PdfPrint.print(PdfPrint.java:18)
at com.uttampanchasara.pdfgenerator.CreatePdf.savePdf(CreatePdf.java:101)
at com.uttampanchasara.pdfgenerator.CreatePdf.access$savePdf(CreatePdf.java)
at com.uttampanchasara.pdfgenerator.CreatePdf$create$1.onPageFinished(CreatePdf.java:30)
at O7.b(O7.java:2)
at Do.handleMessage(Do.java:65)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:228)
at android.app.ActivityThread.main(ActivityThread.java:7819)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:981)
I'm facing like this error, can you please give me any solution?
Thanks
Ashok
I want to generate a report from a list in proper format. This is working fine but it does not compiling html tags like <br and \n or \t
If you can help me out that would be great.
Thanks in Advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.