如何在C中将缓冲区数据写入PDF文件 [英] How to write buffer data into PDF file in C

查看:130
本文介绍了如何在C中将缓冲区数据写入PDF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我在AIX上用纯C语言编写代码.
我想读取PDF文件并将数据存储在缓冲区中.
然后从该缓冲区中将其写入另一个PDF文件.
PDF文件有任何功能.
我用了fputs(buffer,fileptr);
但是它以不同的格式写入数据.

如何从PDF读取数据并将其写入另一个PDF文件.

请帮帮我.
在此先感谢.

Hello,

I am writting a code in plain C on AIX.
I want to read PDF file and store data in buffer.
and from that buffer i need to write it into another PDF file.
Is there any function for PDF files.
I used fputs(buffer,fileptr);
But it is writting data in different format.

How to read data from PDF and write it into another PDF file.

Please help me out.
Thanks in advance.

推荐答案

Poonamol写道:
Poonamol wrote:

但这是在写入数据不同的格式.

But it is writting data in different format.



不,这不对.数据将完全按照所提供的进行写入.如果您的文件不再是有效的PDF,则您的代码已损坏.如果您只是要进行复制,是否可以访问标准C之上可能提供文件复制例程的任何特定于平台的库?



No, it''s not. The data is written exactly as it''s provided. If your file is no longer a valid PDF, then your code is broken. If you''re just making a copy, do you have access to any sort of platform specific libraries above standard C that might offer a file copy routine ?


感谢回复.

我想从数据库服务器复制该PDF文档,并将其存储到AIX服务器上.
Thanks for reply.

I want to copy that PDF document from DB server and store it on to AIX server.


PDF文件以专有格式构造(可以从Adobe网站获取规范),并且不是简单的文本文件.要将这样的文件从一个位置复制到另一个位置,应使用fread()fwrite().
PDF files are structured in a proprietary format (you can get the specification from the Adobe website) and are not simple text files. To copy such a file from one location to another you should use fread()and fwrite().


这篇关于如何在C中将缓冲区数据写入PDF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆