Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Draw Text  Pdf created with CrystalReport
  FAQ FAQ  Forum Search   Register Register  Login Login

Draw Text Pdf created with CrystalReport

 Post Reply Post Reply
Author
Message
cimar View Drop Down
Beginner
Beginner


Joined: 04 Aug 15
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote cimar Quote  Post ReplyReply Direct Link To This Post Topic: Draw Text Pdf created with CrystalReport
    Posted: 04 Aug 15 at 3:33PM
Hi all,

We have the following problem: We create reports with Crystal Reports an export this Reports with Crystal Reports to PDF. After this we want to add a new text to the document.

The inserted text is not visible but the Modification Time for File is changed. Also the new Font 
(Helvetica) is added to the document Property. 


I tested with a PDF created by Word and it's work.
Only the Pdf Files created with Crystal Reports are wrong. 

We use QuickPdf Library 10.

My Code:

 LoadFromFile( "C:\test\filename.pdf" , ""); 
 SetMeasurementUnits(1); 
 SetTextSize(10);
 DrawText(10,PageHeight() - 25,"New Text");
 SaveToFile("C:\test\filename.pdf");

Any Idee, why the inserted Text isn't visible ?

Thanks for any help.

Back to Top
cimar View Drop Down
Beginner
Beginner


Joined: 04 Aug 15
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote cimar Quote  Post ReplyReply Direct Link To This Post Posted: 05 Aug 15 at 8:18AM
I analysed the changed PDF with ExtractFilePageText(pcFileName, "", 1, 0)  function.

The text is available in Document but it is not visible Unhappy


Any Idee, why the inserted text isn't visible ?
Back to Top
Rowan View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 10 Jan 09
Status: Offline
Points: 398
Post Options Post Options   Thanks (1) Thanks(1)   Quote Rowan Quote  Post ReplyReply Direct Link To This Post Posted: 05 Aug 15 at 9:03PM
It sounds like your PDF might have multiple overlapping content streams and the new content is being added underneath another content stream, which is resulting in it not being visible.

There's a few different things you could try. As I don't have your document I can suggest the exact solution, but there's a few things to try.

1. Combine all content streams into one using the CombineContentStreams function

DPL.LoadFromFile("file.pdf"), "");

// Count pages
int xPageCount = DPL.PageCount();

// Go through each page and combine content streams
for (int i = 1; i <= xPageCount; i++)
{
    DPL.SelectPage(i);
    DPL.CombineContentStreams();
}

// Save the updated file
DPL.SaveToFile("new_file.pdf");

2. Reverse the order of the content streams in the document

The sample code below also demonstrates how to create content streams to demonstrate how to reverse them. The code below should produce two PDF files, one with hidden text and one with visible text.

// By default there is a blank document loaded into memory
// which consists of one page with one content stream

// 0,0 coordinates start top left of page
DPL.SetOrigin(1);

// Draw something on first content stream.
DPL.SelectContentStream(1);
DPL.DrawText(100, 100, "Hello World");

// Create a new content stream and
// add a box with a fill in color
// which will hide the text added in
// the first content stream
int posInIndex = DPL.NewContentStream();
DPL.SelectContentStream(posInIndex);
DPL.SetFillColor(0.1, 0.6, 0.9);
DPL.DrawBox(100, 80, 100, 100, 1);

// Save the PDF with hidden text to use as comparison later
DPL.SaveToFile(@"C:\Temp\Content Streams\hidden_text.pdf");

// Now lets reverse the order of the content streams
int xContentStreamCount = DPL.ContentStreamCount();

for (int x = 1; x <= xContentStreamCount; x++)
{
     DPL.SelectContentStream(x);
     int xMoveContentStreamResult = DPL.MoveContentStream(xContentStreamCount, x);
}
// Save the new PDF with the content stream order reversed
DPL.SaveToFile(@"C:\Temp\Content Streams\visible_text.pdf");

If this doesn't fix the problem for you then we'll need to look at your PDF. This isn't a common issue, the content streams in the reports must have been created in a slightly unusual way.





Edited by Rowan - 05 Aug 15 at 9:03PM
Back to Top
cimar View Drop Down
Beginner
Beginner


Joined: 04 Aug 15
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote cimar Quote  Post ReplyReply Direct Link To This Post Posted: 07 Aug 15 at 11:08AM
Thanks,

It's work with CombineContentStreams(). Smile
Back to Top
rafael.camaraa View Drop Down
Beginner
Beginner


Joined: 01 Oct 17
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote rafael.camaraa Quote  Post ReplyReply Direct Link To This Post Posted: 01 Oct 17 at 11:21PM
Hi Rowan,

I´m using Crystal Reports 8.5 in my vb6 application. Normally I use quick PDF library to drawn some PDF documents but now I want to convert my .rpt from Crystal Report to PDF using quick PDF library.

Can you help me with some example to convert .rpt to PDF using quick PDF library.

I want to save this rpt below as PDF


                  Rel.ReportFileName = App.Path & "\RELATORIOS\boletoBradesco.rpt"

PS: I know that Crystal Report 8.5 has option to export as PDF but some reports we have a problem on the barcode, that is why I want use quick PDF library.


Thanks in advance,

Rafael Câmara
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 02 Oct 17 at 3:33PM
Hi Rafael,

you've seen that this thread is more than two years old?
It's not good adding a new prob at the end of a thread regarding another prob ;-)
And please keep in mind that this is a user-user-forum and no real product support forum.

Cheers,
Ingo

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store