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

Export to pdf #42

Closed
tiagocampo opened this issue May 5, 2014 · 32 comments
Closed

Export to pdf #42

tiagocampo opened this issue May 5, 2014 · 32 comments
Assignees

Comments

@tiagocampo
Copy link
Collaborator

python-reportlab

http://www.blog.pythonlibrary.org/2010/03/08/a-simple-step-by-step-reportlab-tutorial/
https://www.reportlab.com/docs/reportlab-userguide.pdf

@tiagocampo tiagocampo self-assigned this May 5, 2014
tiagocampo added a commit that referenced this issue May 13, 2014
Please, give me some feedback of enhancements in this function.
@tiagocampo
Copy link
Collaborator Author

Please, give me some feedback about this function.

@dpizetta
Copy link
Collaborator

You don't connect the button with the functionality. How can you call the function, how can we use?

Please, add the dependence in the list of dependencies.

@tiagocampo
Copy link
Collaborator Author

Do what you do to export in xml, json or csv but now you can export to pdf
as well.

Yeah, I forgot to put reportlab in the dependences! I'll do soon.

On Tue, May 13, 2014 at 2:22 PM, Daniel Pizetta notifications@github.comwrote:

You don't connect the button with the functionality. How can you call the
function, how can we use?

Please, add the dependence in the list of dependencies.


Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-42985083
.

                  Tiago de Campos
  ----------------------------------------------------------

                Skype: tiagocampo1
  https://www.facebook.com/tiagodecampo

@dpizetta
Copy link
Collaborator

But we have a print to pdf button!

On Tue, May 13, 2014 at 2:35 PM, tiagocampo notifications@github.comwrote:

Do what you do to export in xml, json or csv but now you can export to pdf
as well.

Yeah, I forgot to put reportlab in the dependences! I'll do soon.

On Tue, May 13, 2014 at 2:22 PM, Daniel Pizetta notifications@github.comwrote:

You don't connect the button with the functionality. How can you call
the
function, how can we use?

Please, add the dependence in the list of dependencies.

Reply to this email directly or view it on GitHub<
https://github.com/zericardo182/sci-corpus/issues/42#issuecomment-42985083>

.

Tiago de Campos

Skype: tiagocampo1
https://www.facebook.com/tiagodecampo

Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-42986788
.

@tiagocampo
Copy link
Collaborator Author

I didnt know that! hahaha

On Tue, May 13, 2014 at 2:37 PM, Daniel Pizetta notifications@github.comwrote:

But we have a print to pdf button!

On Tue, May 13, 2014 at 2:35 PM, tiagocampo <notifications@github.com

wrote:

Do what you do to export in xml, json or csv but now you can export to
pdf
as well.

Yeah, I forgot to put reportlab in the dependences! I'll do soon.

On Tue, May 13, 2014 at 2:22 PM, Daniel Pizetta <
notifications@github.com>wrote:

You don't connect the button with the functionality. How can you call
the
function, how can we use?

Please, add the dependence in the list of dependencies.

Reply to this email directly or view it on GitHub<

#42 (comment)

.

Tiago de Campos

Skype: tiagocampo1
https://www.facebook.com/tiagodecampo

Reply to this email directly or view it on GitHub<
#42 (comment)

.


Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-42987001
.

                  Tiago de Campos
  ----------------------------------------------------------

                Skype: tiagocampo1
  https://www.facebook.com/tiagodecampo

@dpizetta
Copy link
Collaborator

Very nice :) May we can use something like this...just past as a parameter this variables in pdf function.

And we need to add a little image, sci corpus logo on footer.

screenshot from 2014-05-13 15 47 58

@dpizetta
Copy link
Collaborator

I forgot! The first page should be the cover, with title, authors' name and a description - that we can insert class name and professor, all centralized. Just pass those parameters for me in the function and see how to put the number of the pages. :) Good job :)

@tiagocampo
Copy link
Collaborator Author

I just need to know how to create separated pages, uaheuahe.

Yes, these are all the parameters that we will need.

On Tue, May 13, 2014 at 3:55 PM, Daniel Pizetta notifications@github.comwrote:

I forgot! The first page should be the cover, with title, authors' name
and a description - that we can insert class name and professor, all
centralized. Just pass those parameters for me in the function and see how
to put the number of the pages. :) Good job :)


Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-42996918
.

                  Tiago de Campos
  ----------------------------------------------------------

                Skype: tiagocampo1
  https://www.facebook.com/tiagodecampo

tiagocampo added a commit that referenced this issue May 15, 2014
Prety ugly pdf generation, but its working.
@dpizetta
Copy link
Collaborator

I implemented the dialog, its working, it needs some adaptation from exportToPDF function to receive titlle, description and author's name. To see how you get this information, see ACCEPT function in pdf_dlg.py file. I'm writting all those parameters in preferences, so you just need to know the keys.

I remove page numbers, its better always have. Font and size maybe not work at this moment because of the available ones in report lab, we need to talk.

@dpizetta
Copy link
Collaborator

We need to think about functionality, the class concept is not correct at all. Its too confusing.

@dpizetta
Copy link
Collaborator

http://www.reportlab.com/docs/platypus-example.py

Please dont change until we talk about it.

@tiagocampo
Copy link
Collaborator Author

Actually, this code is more similar to ours:
http://code.activestate.com/recipes/123612-basedoctemplate-with-2-pagetemplate/

On Tue, May 20, 2014 at 8:07 PM, Daniel Pizetta notifications@github.comwrote:

http://www.reportlab.com/docs/platypus-example.py

Please dont change until we talk about it.


Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-43694706
.

                  Tiago de Campos
  ----------------------------------------------------------

                Skype: tiagocampo1
  https://www.facebook.com/tiagodecampo

@dpizetta
Copy link
Collaborator

More exemples...
http://www.reportlab.com/snippets/13/

@tiagocampo
Copy link
Collaborator Author

Yes, this example is what I use. Note the class definition!

On Wed, May 21, 2014 at 5:43 PM, Daniel Pizetta notifications@github.comwrote:

More exemples...
http://www.reportlab.com/snippets/13/


Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-43811279
.

                  Tiago de Campos
  ----------------------------------------------------------

                Skype: tiagocampo1
  https://www.facebook.com/tiagodecampo

@tiagocampo
Copy link
Collaborator Author

Still need to remove the italic and fix the font size.

@dpizetta
Copy link
Collaborator

dpizetta commented Jun 3, 2014

Table of contents aren't showing the pages and the dots...

@tiagocampo
Copy link
Collaborator Author

I removed the page number from table of contents. And I dont understand what you mean with dots

@dpizetta
Copy link
Collaborator

dpizetta commented Jun 6, 2014

The table of contents used to be like this:

1.1 Abstract .................................. 12

And now is like that

1.1 Abstract

Without page number and dots...

On Fri, Jun 6, 2014 at 3:56 PM, tiagocampo notifications@github.com wrote:

I removed the page number from table of contents. And I dont understand
what you mean with dots

Reply to this email directly or view it on GitHub
#42 (comment)
.

@tiagocampo
Copy link
Collaborator Author

In my computer is fine. Its shows the dots and the page number.

Actually, i thought that the page number that you are talking where the
number in the bottom left corner.

On Fri, Jun 6, 2014 at 4:03 PM, Daniel Pizetta notifications@github.com
wrote:

The table of contents used to be like this:

1.1 Abstract .................................. 12

And now is like that

1.1 Abstract

Without page number and dots...

On Fri, Jun 6, 2014 at 3:56 PM, tiagocampo notifications@github.com
wrote:

I removed the page number from table of contents. And I dont understand
what you mean with dots

Reply to this email directly or view it on GitHub
<
#42 (comment)

.


Reply to this email directly or view it on GitHub
#42 (comment)
.


Tiago de Campos

tiagocampo added a commit that referenced this issue Jun 6, 2014
Now font and fontsize are being used.
Issue with TOC in Windows need  to be treat in other issue.
@tiagocampo
Copy link
Collaborator Author

I just test the TOC and its working!

toc

@dpizetta
Copy link
Collaborator

dpizetta commented Jun 6, 2014

Another error: export with font Helvetica, use DIM option, size 12.

Traceback (most recent call last):
File "build/bdist.linux-i686/egg/sci_corpus/sci_corpus_main.py", line 829, in printFile

File "build/bdist.linux-i686/egg/sci_corpus/pdf_writer.py", line 216, in exportToPDF
File "/usr/lib/python2.7/dist-packages/reportlab/lib/styles.py", line 209, in add
raise KeyError("Style '%s' already defined in stylesheet" % key)
KeyError: "Style 'phrase_base' already defined in stylesheet"

@dpizetta dpizetta reopened this Jun 6, 2014
@dpizetta
Copy link
Collaborator

dpizetta commented Jun 6, 2014

It generates this error in any configuration of font, size or dim/replace. Bus just after the second export.

MAGIC>

@tiagocampo
Copy link
Collaborator Author

You cause this error when trying to change the font configuration right?

If so, I think I know how to correct this error!

On Fri, Jun 6, 2014 at 5:19 PM, Daniel Pizetta notifications@github.com
wrote:

It generates this error in any configuration of font, size or dim/replace.
Bus just after the second export.

MAGIC>


Reply to this email directly or view it on GitHub
#42 (comment)
.


Tiago de Campos

tiagocampo added a commit that referenced this issue Jun 7, 2014
Now one can change the font name and size withou raising exceptions.
Finally I think that export pdf is closed.
@dpizetta
Copy link
Collaborator

WHen you export a pdf file with the option dim marked, you need to see the parameter in preferences called 'replace where', if is inside markers it means that the text inside the markers need to be dim. Now it works oposite. I think you program it thinking on your example, and it works, but needs to be general and the parameter replace where is for that :)

@dpizetta dpizetta reopened this Jun 15, 2014
@dpizetta
Copy link
Collaborator

When we use 'replace' it works, but dim doesn't.

@tiagocampo
Copy link
Collaborator Author

I will look
Em 15/06/2014 15:05, "Daniel Pizetta" notifications@github.com escreveu:

When we use 'replace' it works, but dim doesn't.


Reply to this email directly or view it on GitHub
#42 (comment)
.

@tiagocampo
Copy link
Collaborator Author

The problem is:

To make the text be bold, it has to begin with "< b >" and end with "< / b >". The function adjustSentence is not implemented to support different begin/end markers. I will not implement this functionality!

This is not an error or a bug in the exportPDF module, you should open another issue to treat this problem. Thanks

@dpizetta
Copy link
Collaborator

The function adjustSentece (from Ze) deal with any kind of markers, inside
or outside.

If you mark the option in pdf export to dim and it was marked replace
inside markers must be dimmed the part outside, because dim has an opposite
functionality from replace!

So if it not working like that, this is a problem in export pdf.

On Mon, Jun 16, 2014 at 10:59 AM, tiagocampo notifications@github.com
wrote:

Closed #42 #42.

Reply to this email directly or view it on GitHub
#42 (comment).

@dpizetta
Copy link
Collaborator

To make the text be bold, it has to begin with "< b >" and end with "< / b >" : You just need to change where you put this, and change the name from interface for BOLD not DIM, in this case.

@tiagocampo
Copy link
Collaborator Author

If you alheary have the solution in your mind, IMPLEMENT IT.

I will not mess with adjustSentence. My part of the deal was to implement
the exporttoPDF module. This module is working WITHOUT BUGS. The miss
behavior are in the interface with another function that is not my
jurisdiction.

On Mon, Jun 16, 2014 at 11:09 AM, Daniel Pizetta notifications@github.com
wrote:

To make the text be bold, it has to begin with "< b >" and end with "< / b

" : You just need to change where you put this, and change the name from
interface for BOLD not DIM, in this case.


Reply to this email directly or view it on GitHub
#42 (comment)
.


Tiago de Campos

@dpizetta
Copy link
Collaborator

I dont want to implement, I was explaining because I will implement all the
other ones that I put. We need to divide the tasks. And since the beggining
it was DIM not BOLD.

On Mon, Jun 16, 2014 at 11:13 AM, tiagocampo notifications@github.com
wrote:

If you alheary have the solution in your mind, IMPLEMENT IT.

I will not mess with adjustSentence. My part of the deal was to implement
the exporttoPDF module. This module is working WITHOUT BUGS. The miss
behavior are in the interface with another function that is not my
jurisdiction.

On Mon, Jun 16, 2014 at 11:09 AM, Daniel Pizetta notifications@github.com

wrote:

To make the text be bold, it has to begin with "< b >" and end with "< /
b

" : You just need to change where you put this, and change the name
from
interface for BOLD not DIM, in this case.

Reply to this email directly or view it on GitHub
<
https://github.com/zericardo182/sci-corpus/issues/42#issuecomment-46182607>

.


Tiago de Campos

Reply to this email directly or view it on GitHub
#42 (comment)
.

@tiagocampo
Copy link
Collaborator Author

Well,

DIM means lack of brightness. How you imagined the implementation ?

On Mon, Jun 16, 2014 at 11:30 AM, Daniel Pizetta notifications@github.com
wrote:

I dont want to implement, I was explaining because I will implement all the
other ones that I put. We need to divide the tasks. And since the beggining
it was DIM not BOLD.

On Mon, Jun 16, 2014 at 11:13 AM, tiagocampo notifications@github.com
wrote:

If you alheary have the solution in your mind, IMPLEMENT IT.

I will not mess with adjustSentence. My part of the deal was to implement
the exporttoPDF module. This module is working WITHOUT BUGS. The miss
behavior are in the interface with another function that is not my
jurisdiction.

On Mon, Jun 16, 2014 at 11:09 AM, Daniel Pizetta <
notifications@github.com>

wrote:

To make the text be bold, it has to begin with "< b >" and end with "<
/
b

" : You just need to change where you put this, and change the name
from
interface for BOLD not DIM, in this case.

Reply to this email directly or view it on GitHub
<

#42 (comment)

.


Tiago de Campos

Reply to this email directly or view it on GitHub
<
#42 (comment)

.


Reply to this email directly or view it on GitHub
#42 (comment)
.


Tiago de Campos

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

No branches or pull requests

2 participants