wxpdfdoc lib directory wrong

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Wolfgang
I live to help wx-kind
I live to help wx-kind
Posts: 180
Joined: Mon Jan 28, 2019 8:22 am

wxpdfdoc lib directory wrong

Post by Wolfgang »

Hello

I downloaded the wxpdfdoc, and extracted it. Then I changed the wx_setup.props

see changes:

Code: Select all

 <wxCompilerPrefix>vc</wxCompilerPrefix>
   <wxMsvcVersion></wxMsvcVersion>
    <wxMsvcVersionAuto></wxMsvcVersionAuto>
   
So that it does not use vc$(toolset). (vc142_x64)

Then I added the include directories and the libdirectory for wxwidgets.

The compiling works and also the programm starts, but the lib is written like this:

Code: Select all

>wxpdfdoc_vc16_pdfdoc.vcxproj -> D:\wxwidgets\wxpdfdoc\build\..\lib\vc_x64_\\wxpdfdocd.lib
but should be ..\lib\vc_64_lib\wxpdfdocd.lib, somehow the lib is replaced with a \. Only thing what I did see that instead of x64 it is named Win64 asProjectfolderplattform inside VC 2019.

vc_lib is working correct, it is only vc_x64_lib what does not work.
Renaming the Win64 to x64 makes matters even more complicated, as suddenly the include from wxwidgets will not work correctly.
Wolfgang
I live to help wx-kind
I live to help wx-kind
Posts: 180
Joined: Mon Jan 28, 2019 8:22 am

Re: wxpdfdoc lib directory wrong

Post by Wolfgang »

Solved it by setting the additional lib directory to vc_x64_.
Just for conformity it would be good if the directory would be vc_x64_lib.
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxpdfdoc lib directory wrong

Post by utelle »

Wolfgang wrote: Tue Nov 05, 2019 5:46 am Solved it by setting the additional lib directory to vc_x64_.
Well, this is of course only a temporary workaround.
Wolfgang wrote: Tue Nov 05, 2019 5:46 am Just for conformity it would be good if the directory would be vc_x64_lib.
I will look into the issue within the next days. Most likely fixing it will require only minor adjustments to the build files.
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxpdfdoc lib directory wrong

Post by utelle »

utelle wrote: Tue Nov 05, 2019 10:07 am I will look into the issue within the next days. Most likely fixing it will require only minor adjustments to the build files.
There were 2 issues in the wx_setup.props property file coming with wxPdfDocument:
  1. A superfluous backslash was added to the library output path
  2. The path suffix was not properly set for Win64 builds
I adjusted the property file. Please download the property file, apply your local changes again (settings for compiler prefix etc), and repeat your build process. And please report back whether this solves the issue. Thanks in advance.
Wolfgang
I live to help wx-kind
I live to help wx-kind
Posts: 180
Joined: Mon Jan 28, 2019 8:22 am

Re: wxpdfdoc lib directory wrong

Post by Wolfgang »

Hello,

Yes everything works correct now.

Would have some wxpdfdoc related questions:

First is it somehow possible to add a created pdf page(index of a book) to the front of another created pdf file (the book)?

In addition to that I would need infront of the pdf file another pdf file, but that could be solved in making images and add the images, am I right?

The bit more tricky is concerning the multicell, is it possible that the beginning of the new line is set separtely?

(In long, I first write some text in the line, in the same line I then write the multicell, as the startpoint of the multicell is taken for all the lines, it does not go to the beginning of the line. So under the previous text the new lines are empty.)

What I thought that maybe in multicell with only 1 line andanother multicell could work, am I correct?
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxpdfdoc lib directory wrong

Post by utelle »

Wolfgang wrote: Wed Nov 06, 2019 8:45 pm Yes everything works correct now.
Thanks for confirming.
Wolfgang wrote: Wed Nov 06, 2019 8:45 pm Would have some wxpdfdoc related questions:

First is it somehow possible to add a created pdf page(index of a book) to the front of another created pdf file (the book)?
With the current version of wxPdfDocument you could create the index as a separate PDF document and combine it in a separate step with the main PDF document. This can be accomplished with the template feature of wxPdfDocument (see the templates sample coming with wxPdfDocument).

This approach is certainly not very convenient. It would be preferrable to be able to adjust the page order within a single document. I will consider to add such a feature to wxPdfDocument.
Wolfgang wrote: Wed Nov 06, 2019 8:45 pm In addition to that I would need infront of the pdf file another pdf file, but that could be solved in making images and add the images, am I right?
Yes. However, if you already have PDF documents you may use the template feature to add them into your resulting PDF document.
Wolfgang wrote: Wed Nov 06, 2019 8:45 pm The bit more tricky is concerning the multicell, is it possible that the beginning of the new line is set separtely?
Not sure, I understand what you intend to accomplish.
Wolfgang wrote: Wed Nov 06, 2019 8:45 pm (In long, I first write some text in the line, in the same line I then write the multicell, as the startpoint of the multicell is taken for all the lines, it does not go to the beginning of the line. So under the previous text the new lines are empty.)
You could use method SetLeftMargin to adjust where the next line(s) start. However, if you want to indent only the first line of the multicell content, this would not work.
Wolfgang wrote: Wed Nov 06, 2019 8:45 pm What I thought that maybe in multicell with only 1 line andanother multicell could work, am I correct?
It is not possible to directly nest multicells. However, you could use wxPdfDocument's XML markup feature (method WriteXML). This feature allows to create rather sophisticated page layouts, since nesting tables is supported.
Wolfgang
I live to help wx-kind
I live to help wx-kind
Posts: 180
Joined: Mon Jan 28, 2019 8:22 am

Re: wxpdfdoc lib directory wrong

Post by Wolfgang »

Thanks for the tipp with the template.

Is there a way to find the position where it stopped writing by multicell?

In Cell there is the way
ln Indicates where the current position should go after the call. Possible values are:
0: to the right
1: to the beginning of the next line
2: below
So with 0 it just stays at the right of the current text, with multicell however it all the time jumps back to the beginning of the line. To correct the line is not a problem, but to find the place right to the last printed character is a problem.
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxpdfdoc lib directory wrong

Post by utelle »

Wolfgang wrote: Thu Nov 07, 2019 8:59 am Thanks for the tipp with the template.
You are welcome.
Wolfgang wrote: Thu Nov 07, 2019 8:59 am Is there a way to find the position where it stopped writing by multicell?
The MultiCell method sets the current position to the beginning of the next line below. And this is the intended behaviour.
Wolfgang wrote: Thu Nov 07, 2019 8:59 am In Cell there is the way
ln Indicates where the current position should go after the call. Possible values are:
0: to the right
1: to the beginning of the next line
2: below
So with 0 it just stays at the right of the current text, with multicell however it all the time jumps back to the beginning of the line. To correct the line is not a problem, but to find the place right to the last printed character is a problem.
The MultiCell method does not keep track of the position where the content of the last line ended. Use method Write instead of MultiCell. The drawback is that the text written by consecutive calls to method Write can't be justified. If you need justified text (except for the last line), you could use method LineCount to determine the number of lines occupied by your text, and then restrict MultiCell to use one line less, and only write the remaining characters with method Write. Method MultiCell returns the position of character in the input string where output ended.
Wolfgang
I live to help wx-kind
I live to help wx-kind
Posts: 180
Joined: Mon Jan 28, 2019 8:22 am

Re: wxpdfdoc lib directory wrong

Post by Wolfgang »

Does multicell justify just with the length of line or also the margin, whichever comes first?
As it seams it only justifies the length of the line and ignoring the right margin all together and writes the one line length to it.
Wolfgang
I live to help wx-kind
I live to help wx-kind
Posts: 180
Joined: Mon Jan 28, 2019 8:22 am

Re: wxpdfdoc lib directory wrong

Post by Wolfgang »

so managed to write a cell in the first line behind it a multicell (1 line with shorter length) then rest of multicell with normal line length.

Together with your hint of only writing all lines except the last one, I guess it should be possible to get the position, as then the last line will be written as Cell again.

So thanks together with your help, I think I will manage it.
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxpdfdoc lib directory wrong

Post by utelle »

Wolfgang wrote: Thu Nov 07, 2019 12:30 pm Does multicell justify just with the length of line or also the margin, whichever comes first?
As it seams it only justifies the length of the line and ignoring the right margin all together and writes the one line length to it.
It depends. If the width parameter of method MultiCell is set to 0, the right margin will be used. Otherwise the given cell width will be used. However, lines with explici line breaks and the last line will not be justified.
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxpdfdoc lib directory wrong

Post by utelle »

Wolfgang wrote: Thu Nov 07, 2019 12:47 pm so managed to write a cell in the first line behind it a multicell (1 line with shorter length) then rest of multicell with normal line length.

Together with your hint of only writing all lines except the last one, I guess it should be possible to get the position, as then the last line will be written as Cell again.
There might exist better approaches. However, this would require to better understand your actual requirements.
Wolfgang wrote: Thu Nov 07, 2019 12:47 pm So thanks together with your help, I think I will manage it.
Feel free to ask further questions if necessary.
Wolfgang
I live to help wx-kind
I live to help wx-kind
Posts: 180
Joined: Mon Jan 28, 2019 8:22 am

Re: wxpdfdoc lib directory wrong

Post by Wolfgang »

I have the bibel in a database (each word a own record). In front of each verse I write the versnumbers. Inside the verses there might exist notes, which then will have a separate fontsize and are indicated with numbers. The notes then should be written to the footer. Problem I just saw, is that the footer is not like the header which can be freely set. So I have to create my own footer handler inside the normal page. But should be possible.
XML was first my thought as well. But as I found that multicell makes it much easier as it takes care for line and pagebreaks quiet simple.
As I will use the pdf only for printing it works good enough, what I had with the word I have now already, the notes is new, and I did not even have with word.
Wolfgang
I live to help wx-kind
I live to help wx-kind
Posts: 180
Joined: Mon Jan 28, 2019 8:22 am

Re: wxpdfdoc lib directory wrong

Post by Wolfgang »

Ok, I managed it, also for the normal pdf for printing everything is fine. For the pdf with colours, I have some problems, but decided to leave it for now. As it is anyway just for screen view. Where the programm not works.

The problem I write now:
As you know I wanted to first import some pages and then the index then the body of the book.
So as I cannot place the index after I created the body.pdf. I first created the body of the book(body.pdf), and saved information for the index, I imported some pages from a pdf, then creating the index from the memory, then I would have to import the body.pdf (with 1196 pages) so this takes ages,is there any other way. As the importing of the pages takes longer than creating them.I would need to somehow place the index in the middle of the pdf. How could i achieve that?
utelle
Moderator
Moderator
Posts: 1125
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: wxpdfdoc lib directory wrong

Post by utelle »

Wolfgang wrote: Thu Nov 14, 2019 4:15 pm Ok, I managed it, also for the normal pdf for printing everything is fine. For the pdf with colours, I have some problems, but decided to leave it for now. As it is anyway just for screen view. Where the programm not works.
Nevertheless I'd like to know which kind of problems you experienced with colours.
Wolfgang wrote: Thu Nov 14, 2019 4:15 pm The problem I write now:
As you know I wanted to first import some pages and then the index then the body of the book.
So as I cannot place the index after I created the body.pdf. I first created the body of the book(body.pdf), and saved information for the index, I imported some pages from a pdf, then creating the index from the memory, then I would have to import the body.pdf (with 1196 pages) so this takes ages,
Indeed, this is not the kind of task wxPdfDocument was created for.
Wolfgang wrote: Thu Nov 14, 2019 4:15 pm is there any other way. As the importing of the pages takes longer than creating them.I would need to somehow place the index in the middle of the pdf. How could i achieve that?
Unfortunately, wxPdfDocument doesn't offer any option to overcome this problem at the moment. As I wrote in a previous post I consider to add a feature for reordering pages, but I can't give you an estimate when such a feature will be available.

For the time being you could look for an external tool which allows you to combine different PDF files and/or reorder pages within a PDF file. One such tool could be Coherent PDF Command Line Tools.
Post Reply