Yes i fount this function
Now i am in this function:
I mark line in red when i finished this line i got
the sSrc  become empty however rString is not empty:
 m_pHeapBuffer 0x11bb5fc8 "TEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXT"


PdfString PdfSimpleEncoding::ConvertToEncoding( const PdfString & rString,
const PdfFont* ) const
{
  if( !m_pEncodingTable )
  const_cast<PdfSimpleEncoding*>(this)->InitEncodingTable();

  PdfString sSrc = rString.ToUnicode(); // make sure the string is unicode
and not PdfDocEncoding!
  pdf_long lLen = sSrc.GetCharacterLength();

  if( !lLen )
  return PdfString("");

  char* pDest = static_cast<char*>(malloc( sizeof(char) * (lLen + 1) ));
  if( !pDest )
  {
  PODOFO_RAISE_ERROR( ePdfError_OutOfMemory );
  }

  const pdf_utf16be* pszUtf16 = sSrc.GetUnicode();
  char* pCur = pDest;

  for( int i=0;i<lLen;i++ )
  {
  pdf_utf16be val = pszUtf16[i];
#ifdef PODOFO_IS_LITTLE_ENDIAN
  val = ((val & 0xff00) >> 8) | ((val & 0xff) << 8);
#endif // PODOFO_IS_LITTLE_ENDIAN

  *pCur = m_pEncodingTable[val];

  if( *pCur ) // ignore 0 characters, as they cannot be converted to the
current encoding
  ++pCur;
  }

  *pCur = '\0';

  PdfString sDest( pDest ); // fake a PdfDocEncoding string .... would be
more clear if we return a buffer
  free( pDest );

  return sDest;
}
when i return from this function the sDest m_pHeapBuffer is  0x00000000 <Bad
Ptr> char *


2009/6/9 Vad N <[email protected]>

> yes i set the breakpoint
> and starting my debugger.
>
> 2009/6/9 Dominik Seichter <[email protected]>
>
>> Hi,
>>
>> Could you set a breakpoint on painter_.DrawText(...) and see where the
>> contents of the text are lost. It should be quite visible where the text
>> disappears. This information would be helpful.
>>
>> Linking of freetype seems to be ok as the fonts are available.
>>
>> best regards,
>>        Dom
>>
>> Am Dienstag, 9. Juni 2009 schrieb Vad N:
>> > Till now i use podofo like static library and i draw text ang images
>> lines
>> > well
>> > but now i use shared library
>> > maybe links to thirdparty(fretype, libjpeg) doesnt work.
>> > Mabe need additional configuration for my project?
>> > 2009/6/9 Vad N <[email protected]>
>> >
>> > > Do you use PoDoFo trunk
>> > >
>> > > Yes I do.
>> > >
>> > >> Which encoding
>> > >
>> > > do you use?
>> > >
>> > > If i understand correctly you mean the charackter encoding?
>> > >
>> > > In VS2005  I set the Charckter set option  to Use Multi-Byte Character
>> > > Set
>> > >
>> > >
>> > > 2009/6/9 Dominik Seichter <[email protected]>
>> > >
>> > >> Hi,
>> > >>
>> > >> This code produces a correct PDF file including the text on my
>> system.
>> > >> See the
>> > >> attached PDF tttttt.pdf.
>> > >>
>> > >> The fonts are embedded corrrectly, too, in the PDF you sent me. If I
>> > >> edit the
>> > >> PDF manually (using PoDoFo browser) and append the text (Test) Tj, it
>> > >> works,
>> > >> too (see vad2.pdf).
>> > >>
>> > >> Some how hex encoding of the text does not work on your system. Which
>> > >> encoding
>> > >> do you use? Which version of PoDoFo do you use? Do you use PoDoFo
>> trunk?
>> > >>
>> > >> best regards,
>> > >>        Dom
>> > >>
>> > >> Am Dienstag, 9. Juni 2009 schrieb Vad N:
>> > >> > Thanks for the help
>> > >> > My code snippet is:
>> > >> > //----START
>> > >> > PoDoFo::PdfMemDocument pdfDocument_;
>> > >> >  PoDoFo::PdfPainter painter_;
>> > >> >
>> > >> >  PoDoFo::PdfPage *Page_;
>> > >> >  PoDoFo::PdfOutlines* outlines_;
>> > >> >  PoDoFo::PdfOutlineItem* pRoot_;
>> > >> >
>> > >> >  outlines_ = pdfDocument_.GetOutlines();
>> > >> >
>> > >> >  pRoot_ = outlines_->CreateRoot("Document");
>> > >> >
>> > >> >  Page_ = pdfDocument_.CreatePage(
>> > >>
>> > >> PoDoFo::PdfPage::CreateStandardPageSize(
>> > >>
>> > >> > PoDoFo::ePdfPageSize_A4 ) );
>> > >> >
>> > >> >  painter_.SetPage( Page_);
>> > >> >
>> > >> >  pRoot_->CreateChild( "Line Test", PoDoFo::PdfDestination( Page_ )
>> );
>> > >> >
>> > >> >  painter_.FinishPage();
>> > >> >
>> > >> >  Page_ =
>> > >>
>> > >> pdfDocument_.CreatePage(PoDoFo::PdfPage::CreateStandardPageSize(
>> > >>
>> > >> > PoDoFo::ePdfPageSize_Letter ));
>> > >> >
>> > >> >  painter_.SetPage( Page_);
>> > >> >
>> > >> >  pRoot_->CreateChild( "Line Test", PoDoFo::PdfDestination( Page_ )
>> );
>> > >> >
>> > >> >  pRoot_->Last()->CreateNext( "Table", PoDoFo::PdfDestination( Page_
>> )
>> > >> > );
>> > >> >
>> > >> >   PoDoFo::PdfFont* pFont;
>> > >> >
>> > >> >   pFont = pdfDocument_.CreateFont( "Arial" );
>> > >> >
>> > >> >   if( !pFont )
>> > >> >   {
>> > >> >   PODOFO_RAISE_ERROR( PoDoFo::ePdfError_InvalidHandle );
>> > >> >   }
>> > >> >
>> > >> >   pFont->SetFontSize(12);
>> > >> >
>> > >> >   painter_.SetFont( pFont );
>> > >> >
>> > >> >   painter_.SetColor( 0,0,0);
>> > >> >
>> > >> >   painter_.DrawText(11,11,
>> > >> > "TEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXTTEXT");
>> > >> >
>> > >> >   painter_.FinishPage();
>> > >> >
>> > >> >   pdfDocument_.Write("ttttttttttttt.pdf");
>> > >> >
>> > >> > //----END
>> > >> > Also i attach pdf document
>> > >> >
>> > >> >
>> > >> > 2009/6/9 Dominik Seichter <[email protected]>
>> > >> >
>> > >> > > Hi,
>> > >> > >
>> > >> > > We really like everyone to help here on this list. But how shall
>> we
>> > >>
>> > >> help
>> > >>
>> > >> > > you,
>> > >> > > without an example PDF or a test case?
>> > >> > > I only can help if I can reproduce the issue or see your code so
>> > >> > > that
>> > >>
>> > >> I
>> > >>
>> > >> > > can find any problems. Without any information, I can just guess
>> and
>> > >>
>> > >> this
>> > >>
>> > >> > > would waste my and your time.
>> > >> > >
>> > >> > > Please send a test case or an example. Thanks.
>> > >> > >
>> > >> > > Best regards,
>> > >> > >        dom
>> > >> > >
>> > >> > > Am Dienstag, 9. Juni 2009 schrieb Vad N:
>> > >> > > > Hi.
>> > >> > > > I use VS2005
>> > >> > > > I create podofo shared library and try to use it in my app.
>> > >> > > > I dont know why, but the document produced is without text.
>> > >> > > > Maybe you know how to solve this problem?
>> > >> > >
>> > >> > > --
>> > >> > >
>> ********************************************************************
>> > >> > >** Dominik Seichter - [email protected]
>> > >> > > KRename  - http://www.krename.net  - Powerful batch renamer for
>> KDE
>> > >> > > KBarcode - http://www.kbarcode.net - Barcode and label printing
>> > >> > > PoDoFo - http://podofo.sf.net - PDF generation and parsing
>> library
>> > >> > > SchafKopf - http://schafkopf.berlios.de - Schafkopf, a card
>> game,
>> > >>
>> > >>  for
>> > >>
>> > >> > > KDE Alan - http://alan.sf.net - A Turing Machine in Java
>> > >> > >
>> ********************************************************************
>> > >> > >**
>> > >>
>> > >> --
>> > >>
>> **********************************************************************
>> > >> Dominik Seichter - [email protected]
>> > >> KRename  - http://www.krename.net  - Powerful batch renamer for KDE
>> > >> KBarcode - http://www.kbarcode.net - Barcode and label printing
>> > >> PoDoFo - http://podofo.sf.net - PDF generation and parsing library
>> > >> SchafKopf - http://schafkopf.berlios.de - Schafkopf, a card game,
>>  for
>> > >> KDE
>> > >> Alan - http://alan.sf.net - A Turing Machine in Java
>> > >>
>> **********************************************************************
>>
>>
>>
>> --
>> **********************************************************************
>> Dominik Seichter - [email protected]
>> KRename  - http://www.krename.net  - Powerful batch renamer for KDE
>> KBarcode - http://www.kbarcode.net - Barcode and label printing
>> PoDoFo - http://podofo.sf.net - PDF generation and parsing library
>> SchafKopf - http://schafkopf.berlios.de - Schafkopf, a card game,  for
>> KDE
>> Alan - http://alan.sf.net - A Turing Machine in Java
>> **********************************************************************
>>
>
>
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to