Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content before autotable #2

Closed
czegarram opened this issue Sep 9, 2014 · 11 comments
Closed

Content before autotable #2

czegarram opened this issue Sep 9, 2014 · 11 comments

Comments

@czegarram
Copy link

¿Is there a way to add a title and some text before autotable?

@czegarram
Copy link
Author

Btw, thanks for your library.

@simonbengtsson
Copy link
Owner

simonbengtsson commented Sep 9, 2014

What I did was to increase the top margin a bit and then write a title with the native jsPDF api. There is an example on how to do this in examples/example.js.

You might find support for this limited right now though. It is very much something I'm working on improving though!

@czegarram
Copy link
Author

Thank for the advice. Another thing I realized is the support of unicode symbols inside a jsPDF doc.
You can't use for example: \uXXXX to refer symbols from UTF-8.
Btw, Good Work Here!

@simonbengtsson
Copy link
Owner

No that is true, the issue can be tracked here . Swedish and German characters such as åäö seem to work fine though.

@simonbengtsson
Copy link
Owner

Better support for this was released in version 1.0. An example "With content" also exist in /examples/examples.js.

@BeckhamVinoth
Copy link

BeckhamVinoth commented Aug 5, 2016

Hi Simon , How to add two sentences in pageBeforeContent ?
Ex : 1). content X
2) content Y .
is it possible huh ?

@simonbengtsson
Copy link
Owner

Not sure what you mean. If you have a question about how to do something with the plugin it would be easier if you created a question on stackoverflow with more information. I actively monitor the jspdf-autotable tag.

@BeckhamVinoth
Copy link

BeckhamVinoth commented Aug 5, 2016

beforePageContent: function(data) {
doc.setFontSize(12);
doc.setFont("courier");
doc.text("Content X " ,20, 15);
doc.text("Content Y" ,20, 15);
}
What am trying to do here is , Printing the Content Y in the next line of Content X , But it's getting Overlapped

@simonbengtsson
Copy link
Owner

Aha! Make sure you use the doc.text function correctly. Its signature is like this jsPDF.text(x, y, text).

@BeckhamVinoth
Copy link

Yes man , You are right . I just Misunderstood that . Thanks Buddy @simonbengtsson

@Krenabothu
Copy link

doc.text(400, 50, "Daily View");
doc.autoTable({
headStyles: { fontSize: 10, headerBackgroundColor:"red" },
backgroundColor:"red",
bodyStyles: { fontSize: 8 },
head: [filedNames],
body: dailyRows,
// options
// ...
});

doc.text("Weekly View", 400, doc.autoTable.previous.finalY + 10);
doc.autoTable({
headStyles: { fontSize: 10},
bodyStyles: { fontSize: 8},
head: [filedNames],
body: weeklyRows,
// options
// ...
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants