HBVPDF : An error exists on this page. Acrobat may not display the page correctly.

288 views
Skip to first unread message

Moshe Mordkovych

unread,
Dec 2, 2016, 9:52:15 AM12/2/16
to Harbour Users
Hi All,

I produce report with hbvpdf. All is ok but when scrolling in gives this error (on some pages)

An error exists on this page. Acrobat may not display the page correctly. Please contact the person who created the PDF document to correct the problem.

I need to eliminate the error, it will make me customer nervous

Please help

Toni Martins

unread,
Dec 2, 2016, 9:59:56 AM12/2/16
to Harbour Users
Can you post the code?
Or you can supress some lines to see here the problem is.

José Maria Quintas

unread,
Dec 2, 2016, 10:27:55 AM12/2/16
to harbou...@googlegroups.com
"please contat the person who created the PDF document to correct the problem"

at momment, this person is you.

hbvpdf is on /extras folder.
Need caution to use anything available on this folder.

You can help, trying to identify what is causing error.
As example, you can eliminate some part of PDF routine, to check if solves problem.
May be you create a invalid code.

Another option is contrib\hbhpdf, a harupdf wrapper.

Now you decide:
Can help to a better hbvpdf, or change to hbhpdf.
For sure, without more information, there is nothing to do.

José M. C. Quintas
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Moshe Mordkovych

unread,
Dec 2, 2016, 10:57:48 AM12/2/16
to Harbour Users
Thanks for reply!


On Friday, December 2, 2016 at 10:27:55 AM UTC-5, José M. C. Quintas wrote:
"please contat the person who created the PDF document to correct the problem"

at moment, this person is you.

Yes!
 

hbvpdf is on /extras folder.
Need caution to use anything available on this folder.

You can help, trying to identify what is causing error.
As example, you can eliminate some part of PDF routine, to check if solves problem.
May be you create a invalid code.

Ok will try eliminate code


 

Moshe Mordkovych

unread,
Dec 3, 2016, 8:46:24 PM12/3/16
to Harbour Users
Hi!

This is the line in PDF :

0.3 g
377.28 42.3 m 377.28 9.9
1 w l h S

I tryed to add a function just to draw a line :

FUNCTION pdfLine( x1, y1, x2, y2, cUnits ,nWidth)

local cTmp := ""

t_aReport[ PAGEBUFFER ] += CRLF + "0.3 g " // test gray

IF cUnits == "I" // inches
      y1 := t_aReport[ PAGEY ]  - y1 * 72 // unit is 1/72 of inch
      y2 := t_aReport[ PAGEY ]  - y2 * 72 // unit is 1/72 of inch
      x1 := x1 * 72
      x2 := x2 * 72
endif

 t_aReport[ PAGEBUFFER ] += CRLF +  hb_ntos( x1 ) + " " + hb_ntos( y1 ) + " m " + ;
                                    hb_ntos( x2) + " " + hb_ntos( y2 )


if !empty(nWidth)
   t_aReport[ PAGEBUFFER ] += CRLF + hb_ntos(nWidth)+ " w "

endif
t_aReport[ PAGEBUFFER ] += " l h S"


return NIL

I am not familiar with PDF enough to understand what is wrong...



On Friday, December 2, 2016 at 9:59:56 AM UTC-5, Toni Martins wrote:
Can you post the code?
Or you can suppress some lines to see here the problem is.

Lorenzo Fiorini

unread,
Dec 4, 2016, 4:26:24 AM12/4/16
to harbou...@googlegroups.com
l use hbvpdf since years under linux, windows and osx for invoices, orders, product brochures with several lines, boxes, images, backgrounds and so on.
Nobody is reporting any problem.
l would give a better look to the your code.
Just a hint: 0,0 in pdf is like in geometry in the lower left side this is not natural for developers where 0,0 is in the upper side.

best regards,
Lorenzo




--
Saluti,
Lorenzo Fiorini
--

Klas Engwall

unread,
Dec 4, 2016, 5:40:18 AM12/4/16
to harbou...@googlegroups.com
Hi Moshe,

> This is the line in PDF :
>
> 0.3 g
> 377.28 42.3 m 377.28 9.9
> 1 w l h S

It looks to me like the "l" should be moved to after the destination
coordinates. Now the line width "1 w" is inserted before the "l" so
(problem 1) the "l" has no coordinates and (problem 2) the renderer does
not know what "377.28 9.9" is supposed to mean.

Also, I am not sure the "h" should be there. You are drawing a straight
line, and the "h" closes the subpath by appending another straight line
segment back to the starting point like in a polygon.

Regards,
Klas


> I tryed to add a function just to draw a line :
>
> *FUNCTION pdfLine( x1, y1, x2, y2, cUnits ,nWidth)
>
> local cTmp := ""
>
> t_aReport[ PAGEBUFFER ] += CRLF + "0.3 g " // test gray
>
> IF cUnits == "I" // inches
> y1 := t_aReport[ PAGEY ] - y1 * 72 // unit is 1/72 of inch
> y2 := t_aReport[ PAGEY ] - y2 * 72 // unit is 1/72 of inch
> x1 := x1 * 72
> x2 := x2 * 72
> endif
>
> t_aReport[ PAGEBUFFER ] += CRLF + hb_ntos( x1 ) + " " + hb_ntos( y1 )
> + " m " + ;
> hb_ntos( x2) + " " + hb_ntos( y2 )
>
>
> if !empty(nWidth)
> t_aReport[ PAGEBUFFER ] += CRLF + hb_ntos(nWidth)+ " w "
>
> endif
> t_aReport[ PAGEBUFFER ] += " l h S"
>
>
> return NIL
> *
> I am not familiar with PDF enough to understand what is wrong...
>
>
> On Friday, December 2, 2016 at 9:59:56 AM UTC-5, Toni Martins wrote:
>
> Can you post the code?
> Or you can suppress some lines to see here the problem is.
>
>
> sexta-feira, 2 de Dezembro de 2016 às 14:52:15 UTC, Moshe Mordkovych
> escreveu:
>
> Hi All,
>
> I produce report with hbvpdf. All is ok but when scrolling in
> gives this error (on some pages)
>
> *An error exists on this page. Acrobat may not display the page
> correctly. Please contact the person who created the PDF
> document to correct the problem.
>
> *I need to eliminate the error, it will make me customer nervous*
>
> *Please help*
> *
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Harbour Users" group.
> Unsubscribe: harbour-user...@googlegroups.com
> Web: http://groups.google.com/group/harbour-users
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Harbour Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to harbour-user...@googlegroups.com
> <mailto:harbour-user...@googlegroups.com>.

Moshe Mordkovych

unread,
Dec 5, 2016, 10:44:44 AM12/5/16
to Harbour Users
Thank you! The error was caused by "w". I moved it "m"

Klas Engwall

unread,
Dec 5, 2016, 4:06:20 PM12/5/16
to harbou...@googlegroups.com
Hi Moshe,

> Thank you! The error was caused by "w". I moved it "m"

That sounds like a strange solution. Does it draw the line correctly or
just silence the error message? I would be interested in seeing what the
final lines in the PDF file look like after that change.

Regards,
Klas
> > Unsubscribe: harbour-user...@googlegroups.com <javascript:>
> > Web: http://groups.google.com/group/harbour-users
> <http://groups.google.com/group/harbour-users>
> >
> > ---
> > You received this message because you are subscribed to the Google
> > Groups "Harbour Users" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to harbour-user...@googlegroups.com <javascript:>
> > <mailto:harbour-user...@googlegroups.com <javascript:>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Harbour Users" group.
> Unsubscribe: harbour-user...@googlegroups.com
> Web: http://groups.google.com/group/harbour-users
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Harbour Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to harbour-user...@googlegroups.com
> <mailto:harbour-user...@googlegroups.com>.

Moshe Mordkovych

unread,
Dec 6, 2016, 3:19:57 AM12/6/16
to Harbour Users
I moved "w" before "m'. :

0.3 g
1.5 w
377.28 560.70000 m 377.28 528.30000
>     > <mailto:harbour-users+unsub...@googlegroups.com <javascript:>>.
>     > For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Harbour Users" group.
> Unsubscribe: harbour-user...@googlegroups.com
> Web: http://groups.google.com/group/harbour-users
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Harbour Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to harbour-user...@googlegroups.com

Klas Engwall

unread,
Dec 6, 2016, 7:02:20 AM12/6/16
to harbou...@googlegroups.com
Hi Moshe,

> I moved "w" before "m'. :
>
> 0.3 g
> 1.5 w
> 377.28 560.70000 m 377.28 528.30000

OK, I see. When you said it, it sounded a little different from what it
looks like :-) but separating the style operators ("g", "w") from the
path construction operators ("m", "l") like this is a good idea and
follows Adobe's guidelines.

What I am missing here though is the "l" after the destination
coordinates. You probably still have it on a separate line after the
ones you quoted, and that will work. But it is considered "bad style"
and makes the file harder to read when you debug it. The operands
(377.28 and 528.30000) of the "l" operator are supposed to be followed
immediately by the operator itself just like the "m" operator follows
immediately after its operands. So I would suggest that you move the "l"
before the CRLF.

I would also suggest that you round the extra decimals as they just make
the file larger, when there are lots of coordinates on the page, without
providing any benefit. You are specifying some of the coordinates as
1/10000 of 1/72" now. 1/100 of 1/72" is quite enough in real life :-)

To sum it up, I think you will be fine extending the hbvpdf lib. You
just need a little more practice to make it perfect :-)

Regards,
Klas
Reply all
Reply to author
Forward
0 new messages