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!
![]() |
Draw Text Pdf created with CrystalReport |
Post Reply ![]() |
Author | |
cimar ![]() Beginner ![]() Joined: 04 Aug 15 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() 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. |
|
![]() |
|
cimar ![]() Beginner ![]() Joined: 04 Aug 15 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
I analysed the changed PDF with ExtractFilePageText(pcFileName, "", 1, 0) function.
The text is available in Document but it is not visible ![]() Any Idee, why the inserted text isn't visible ?
|
|
![]() |
|
Rowan ![]() Moderator Group ![]() ![]() Joined: 10 Jan 09 Status: Offline Points: 398 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
cimar ![]() Beginner ![]() Joined: 04 Aug 15 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
Thanks,
It's work with CombineContentStreams().
![]() |
|
![]() |
|
rafael.camaraa ![]() Beginner ![]() Joined: 01 Oct 17 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store