PDF-Creation Problem
Hi all,
I have a problem with the RB 10.07 and the TpdfDevice. In a Intraweb
Application I generate a PDF.
On some systems (mostly XP) it is working perfectly. On Windows Server is
does not work.
With each print the size of the output stream differs. The first output is
ok, but the second and consecutive prints are scrambled.
Below is the code which generate the report. Is there something I have
missed or special in an IntraWeb-Application?
Var
fOutputStream : TMemoryStream;
lPDFDevice: TppPDFDevice;
PlanName : String;
begin
lPDFDevice := TppPDFDevice.Create(nil);
try
FOutputStream := TMemoryStream.Create;
try
lPDFDevice.PDFSettings := PPlan.PDFSettings;
lPDFDevice.OutputStream := FOutputStream; // assign output
stream
lPDFDevice.Publisher := PPlan.Publisher;
PPlan.Template.FileName := UserSession.WorkingDir+'PERSPLAN.RTM';
PPlan.Template.LoadFromFile;
PPlan.TextFileName := PlanName;
PPlan.PrintToDevices;
finally
WebApplication.SendStream(foutputStream, true, 'application/pdf',
'PersonalPlan.pdf');
end;
finally
lPDFDevice.Free;
end;
end;
-- Output Stream will be freed by IntraWeb
Greetings from germany
Sven Heuer
I have a problem with the RB 10.07 and the TpdfDevice. In a Intraweb
Application I generate a PDF.
On some systems (mostly XP) it is working perfectly. On Windows Server is
does not work.
With each print the size of the output stream differs. The first output is
ok, but the second and consecutive prints are scrambled.
Below is the code which generate the report. Is there something I have
missed or special in an IntraWeb-Application?
Var
fOutputStream : TMemoryStream;
lPDFDevice: TppPDFDevice;
PlanName : String;
begin
lPDFDevice := TppPDFDevice.Create(nil);
try
FOutputStream := TMemoryStream.Create;
try
lPDFDevice.PDFSettings := PPlan.PDFSettings;
lPDFDevice.OutputStream := FOutputStream; // assign output
stream
lPDFDevice.Publisher := PPlan.Publisher;
PPlan.Template.FileName := UserSession.WorkingDir+'PERSPLAN.RTM';
PPlan.Template.LoadFromFile;
PPlan.TextFileName := PlanName;
PPlan.PrintToDevices;
finally
WebApplication.SendStream(foutputStream, true, 'application/pdf',
'PersonalPlan.pdf');
end;
finally
lPDFDevice.Free;
end;
end;
-- Output Stream will be freed by IntraWeb
Greetings from germany
Sven Heuer
This discussion has been closed.
Comments
How does the output stream differ when you create it with your server app?
Are you still getting a valid PDF file? If you save the PDF to file before
sending it over the server, is it already corrupt?
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
The pdf is mostly valid. (it has a correct start and end header). And yes,
it is corrupt before sending. I had the fear that this was a problem with
the builtin pdf engine. I tried it with gnostice and it looks good. We were
happy.....
But we just moved one hour ago from the dev system to the prod system and
now we have the same "shit". Argh. So it could not be the pdf engine device.
We are using regions and they are streched over the complete page and the
labels are invisible.
I can send you two pdf if you want...
Best regards
Sven
(sorry, i send this to support@.....)
system because we installed a printer driver on the system. It looks that if
there is no printer driver installed, the regions does have a problem. They
are stretching and are in the foreground. Does this make sense for you?
Sven
Sorry for the delay in this response, I somehow lost track of this thread.
I did a test on a machine with no printers installed and was able to
successfully export a report with stretchable regions to PDF without any
problems. Are you able to recreate this issue on any other machines with no
printers or just the Windows Server one?
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I can create this on systems with XP (in a VM) and/or Windows Server 2003
(Standard/Web).
If I just install a printer the problem seems to be gone. (I run this within
Atozed Intraweb)
I have here two pdf outputs to show it. Can I send it to you by mail?
Greetings
Sven
Yes, please send the PDF to support@digital-metaphors.com with the
PDFSettings.Compression property set to clNone and I'll take a look at them
for you.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com