¼¸ºÎ³ß´çÓ빫²îÂÛ̳------ÖÂÁ¦ÓÚ²úÆ·¼¸ºÎÁ¿¹«²î±ê×¼GD&T (GDT:ASME)|New GPS(ISO)Ñо¿/CADÉè¼Æ/CAM¼Ó¹¤/CMM²âÁ¿  


·µ»Ø   ¼¸ºÎ³ß´çÓ빫²îÂÛ̳------ÖÂÁ¦ÓÚ²úÆ·¼¸ºÎÁ¿¹«²î±ê×¼GD&T (GDT:ASME)|New GPS(ISO)Ñо¿/CADÉè¼Æ/CAM¼Ó¹¤/CMM²âÁ¿ » ·ÂÉä¿Õ¼ä£ºCAXÈí¼þ¿ª·¢£¨Èý£©¶þ´Î¿ª·¢Óë³ÌÐòÉè¼Æ » ³ÌÐòÉè¼Æ » Æ»¹ûÓ¦Óÿª·¢
̞
ÃÜÂë
×¢²á °ïÖú »áÔ± ÈÕÀú ÒøÐÐ ËÑË÷ ½ñÈÕÐÂÌû ±ê¼ÇÂÛ̳ΪÒѶÁ


»Ø¸´
 
Ö÷Ì⹤¾ß ËÑË÷±¾Ö÷Ìâ ÏÔʾģʽ
¾É 2011-05-02, 08:35 PM   #1
huangyhg
³¬¼¶°æÖ÷
 
huangyhgµÄÍ·Ïñ
 
×¢²áÈÕÆÚ: 04-03
Ìû×Ó: 18592
¾«»ª: 36
ÏÖ½ð: 249466 ±ê×¼±Ò
×ʲú: 1080358888 ±ê×¼±Ò
huangyhg Ïòןõķ½Ïò·¢Õ¹
ĬÈÏ ¡¾×ªÌû¡¿Îļþ¸ñʽ֮pdf

http://bbs.pediy.com/archive/index.php?t-104633.html
¡¾ÎÄÕ±êÌâ¡¿: Îļþ¸ñʽ֮PDF
¡¾ÎÄÕÂ×÷Õß¡¿: youstar
¡¾×÷ÕßÓÊÏä¡¿: youstar@foxmail.com
¡¾¸öÈËÖ÷Ò³¡¿£ºhttp://www.youstar.org.ru
¡¾×÷ÕßÉùÃ÷¡¿: Ö»ÊÇһЩºÜdzµÄÈÏʶ£¬Ï£Íû´ó¼ÒÒ»ÆðÌÖÂÛ¡£
¡¾ÎÄÕÂÏÂÔØ¡¿£º´úÂëÓëÎÄÕ¼û¸½¼þ
²Î¿¼ÁËÍøÉϵĺܶà֪ʶ£¬×÷Ϊ×Ô¼ºÕûÀíѧϰ£¬²»×ãÖ®´¦Çë´ó¼ÒÀí½âÓëÌÖÂÛ¡£
Ŀ¼£º
1¡¢PDF¸ñʽ·ÖÎö
1.1 header
1.2 Obj
1.3 cross reference table
1.4 trailer
1.5 Îļþβ
1.6 Obj¶ÔÏó
2¡¢VCÉú³ÉPDF
2.1 Ç°ÆÚ×¼±¸
2.2 Ô´Â뼰Ч¹û
3¡¢²Î¿¼×ÊÁÏ
ÕýÎÄ£º
1¡¢PDFÎļþ·ÖÎö
PDFÎļþÖ÷Òª°üº¬ÒÔϼ¸Öֽṹ£º
1.1 header
PDFÎļþµÄµÚÒ»ÐУ¬¸ñʽÈçÏ£º
%PDF-1.1 //±íʾµ±Ç°ÎļþµÄ°æ±¾Îª1.1£¨Ä¿Ç°×î¸ß°æ±¾ÊÇ1.7£©
1.2 Obj (ÎļþÌå)
PDFÖÐÓõ½µÄ¶ÔÏ󣬰üÀ¨Îı¾\ͼÏó\ÒôÀÖ\ÊÓƵ\×ÖÌå\³¬Á¬½Ó\¼ÓÃÜÐÅÏ¢µÈ£¬¸ñʽÈçÏ£º
Àý£º
1 0 obj
//1±êʾÕâ¸öobjµÄÐòºÅ£¬±ãÓÚÔÚxrefÖвéÕÒ£¬0ÊÇÓÃÀ´±êʾ²»Í¬µÄobjÏÖÔÚ¶¼ÊÇ0£¬objÊǹؼü×Ö
<< // ´ÓÕâÀ↑ʼ¸÷ÐоÍÊÇobjµÄÊôÐÔÁË ÒÔ¡°/¹Ø¼ü×Ö Öµ¡±µÄÐÎʽÀ´³öÏÖ
/Type /Catalog //objµÄÀàÐÍÊÇĿ¼catalog
/Outlines 2 0 R //µÚ¶þ¸öobjÊÇoutlines
/Pages 3 0 R //µÚÈý¸öobjÊÇPages
/OpenAction 7 0 R // OpenAction ÔÚµÚ7¸öobj
>>
endobj //Ò»¸öobj½áÊø
1.3 cross reference table
xref
0 5
0000000000 65535 f
0000000009 00000 n
0000000074 00000 n
0000000120 00000 n
0000000179 00000 n

xrefÊÇobjµÄË÷Òý±í£¬ÓÃÀ´Ë÷Òý¸÷¸öobjÔÚÎĵµÖеÄÆðʼλÖã¬ËüµÄÐÎʽÈçÏÂͼ£¬ÆäÖÐ0,211·Ö±ð´ú±íÕâ¸öxrefµÄobjµÄÆðʼºÍÖÕÖ¹ÐòºÅ¡£ÏÂÃæ µÄ¸÷Ðоʹú±í¸÷¸öobjÔÚÕâ¸öÎĵµµÄÆðʼλÖã¬ÆäÖеÚÒ»´®×Ö·û£¨10¸ö£©´ú±íÆðʼλÖã¬ÖмäµÄÎå¸ö×Ö·ûÒ²ÊÇΪÁËÇø·ÖÓõģ¬Ö»Óе±Õâ¸ö¶ÔÏó±»É¾³ýµÄʱºò²ÅÓÐ ÓÃ,±íʾÕâ¸ö¶ÔÏó±»É¾³ýºóÓÖ±»ÖØÐÂÉú³ÉºóµÄ¶ÔÏóºÅ£¬ÏÖÔÚ»ù±¾ÉÏȫΪ0¡£ ºóÃæµÄ×ÖĸÓÐÁ½ÖÖ£ºf´ú±íɾ³ýµÄ£¬n´ú±íҪʹÓõġ£
1.4 trailer
trailer
<<
/Size 8
/Root 1 0 R
>>
ºóÃæµÄtrailerÊǶÔÕû¸öxrefµÄÕªÒª£¬ËµÃ÷ÀïÃæÓжàÉÙ¸öOBJ£¬¶ÁµÄʱºò´ÓÄĸöOBJ¿ªÊ¼½âÎö£¬ÐÅÏ¢½ÚµãµÈ£¬ÆäÖУº
/size :Õâ¸öpdfÖÐ×ܹ²Ê¹ÓÃÁ˶àÉÙ¸ö¶ÔÏó
/root :Õâ¸öpdfÎļþµÄcatalog¶ÔÏóµÄ¶ÔÏóºÅ,ÕâÊÇpdfÖÐ×²ãµÄ¶ÔÏ󣬼´PDFÊÇ×éÖ¯¶ÔÏóºÅ£¬´ËÀýÖÐλ 1 0 R
1.5 Îļþβ
startxref
553
%%EOF
ÒòΪһ¸öÎĵµÖпÉÒÔÓжà¸öxref£¬ËùÒÔÕâÀïÒªÖ¸Ã÷Òª´ÓÄĸöxref¿ªÊ¼½øÐнâÎöÕâ¸öÎļþ¡£
/startxref: ºóÃæµÄÊý×Ö±íʾcross reference tableµÄ¿ªÊ¼Î»Öã¬ÀïÃæµÄÊý×ÖÊÇ10½øÖÆ¡£
/%%EOF :Îļþ½áÊø·û.
1.6 OBJ¶ÔÏó
PdfµÄOBJÖеĶÔÏóÓÐÈçϼ¸ÖÖ£¬ÏÖ½éÉÜÈçÏ£º
(1)ÎļþÃèÊö¶ÔÏó£¬ÓÃÀ´ÃèÊöÕâ¸öÎļþµÄ±êÌ⣬×÷Õߣ¬Ê±¼äµÈ
(2)×é¶ÔÏó£¬Ò²¾ÍÊÇÎĵµÄÚÈݵÄÆðʼ½áµã¡£Type ΪCatalog
(3)Ò³¼¯ºÏ£¬ÀïÃæ¾ÛºÏÁË´óÁ¿µÄÒ³¶ÔÏó¡£ Type Ϊpages
(4)Ò³¶ÔÏó£¬ÀïÃæÖ¸Ã÷Á˵±Ç°Ò³ÀïÃæÓõ½µÄ×ÖÌ壬ÄÚÈÝ£¬»î¶¯¶ÔÏó£¬Í¼Æ¬µÈ¡£Type Ϊpage
(5)»î¶¯¶ÔÏó£¬ÓÐÁ´½Ó£¬ÎÄ×Ö£¬ÉùÒô£¬µçÓ°µÈ£¬Type ΪAnnots
(6)ͼƬ¶ÔÏó£¬ Type Ϊ XObject
(7)×ÖÌå¶ÔÏó£¬Type Ϊ Font ¡£PDF¿ÉÒÔÄÚÖÃ×ÖÌ壬ËùÒÔ¼´Ê¹Ä¿±ê»úÆ÷ÉÏûÓУ¬Ö»ÒªËüÄÚÖÃÁË£¬Ò²¿ÉÒÔÕý³£µØÏÔʾ£¬²»ÊÜÓ°Ïì¡£
(8)Á÷¶ÔÏó¡£ËùÓеĶþ½øÖÆÄÚÈݶ¼ÊÇ´æÔÚÕâ¸ö¶ÔÏóÀïÃ棬ÎļþÁ÷µÄ³£¼ûµÄѹËõ·½Ê½ÊÇ£ºÍ¼Æ¬µÄһЩѹËõËã ·¨£¬FlateDecode,ASCIIHexDecode,ASCII85DecodeµÈµÈ£¬FlateDecodeÊÂʵÉϾÍÊÇZIPµÄѹËõËã·¨¡£Á÷¶Ô ÏóµÄ³¤¶ÈÊǹØÁ¬µ½Ò»¸ö³¤¶È¶ÔÏóÉϵÄ/Length 188 0 RÕâÖÖÐÎʽ¡£188¾ÍÊÇ´æÕâ¸ö³¤¶ÈµÄOBJµÄ˳ÐòºÅ¡£
(9)Êý×Ö¶ÔÏó¡£ÀýÈ磺
188 0 obj
2538
endobj
ÀïÃæÖ»ÓÐÒ»¸öÊý×Ö£¬¾­³£ÓÃÀ´±íʾ³¤¶È¡£
2¡¢VCÉú³ÉPDF
PDFLibÊÇÓÃÓÚ´´½¨PDFÎĵµµÄ¿ª·¢¿â£¬ÌṩÁ˼òµ¥Ò×ÓõÄAPI£¬Òþ²ØÁË´´½¨PDFµÄ¸´ÔÓϸ½ÚÇÒ²»ÐèÒªµÚ3·½Èí¼þµÄÖ§³Ö¡£ÒÑVC±à¼­Ò»¸ö¿ØÖÆÓ¦ÓĄ̃³ÌÐòΪÀýÀ´Éú³ÉÒ»¸öPDF¡£
2.1 Ç°ÆÚ×¼±¸
Ïȵ½PDFLib¹ÙÍøÏÂÔØ¿âÎļþ£¬×îаæΪpdflib8£¬µ«ÊÇÉú³ÉµÄpdfÓÐÒ»¸ö¹ÙÍøµÄÍøÖ·£¬5.0°æ±¾ÒÔÏÂûÓУ¬Á´½ÓµØ Ö·£ºhttp://www.pdflib.com/download/pdfl...̺󣬽«ÏÂÔØ¿âÖÐ pdflib.h,pdflib.dll,pdflib.lib¿½±´µ½¹¤³ÌĿ¼¡£
2.2 Ô´Âë
²ÎÕÕ¹ÙÍøÌṩµÄһЩsample£¬¸Ä±àÁËÒ»¸ö£¬Ô´´úÂëÈçÏ£º
#include "stdafx.h"
#include "pdflib.h"
#pragma comment(lib,"pdflib.lib")
int main()
{
PDF *p;
/* create a new PDFlib object */
if ((p = PDF_new()) == (PDF *) 0)
{
printf("Couldn't create PDFlib object (out of memory)!\n");
return(2);
}
PDF_TRY(p)
{
/* This means we must check return values of load_font() etc. */
PDF_set_parameter(p, "errorpolicy", "return");

if (PDF_begin_document(p, "pediy.pdf", 0, "") == -1)
{
printf("Error: %s\n", PDF_get_errmsg(p));
return(2);
}
// /* This line is required to avoid problems on Japanese systems */
// PDF_set_parameter(p, "hypertextencoding", "host");
PDF_set_info(p, "Creator", "pediy.c");
PDF_set_info(p, "Author", "youstar");
PDF_set_info(p, "Title", "Hello, pediy (C)!");
PDF_begin_page_ext(p, a4_width, a4_height, "");
/* Change "host" encoding to "winansi" or whatever you need! */
font = PDF_load_font(p, "Helvetica-Bold", 0, "host", "");
if (font == -1)
{
printf("Error: %s\n", PDF_get_errmsg(p));
PDF_delete(p);
return(2);
}
PDF_setfont(p, font, 24);
PDF_set_text_pos(p, 50, 700);
PDF_show(p, "pediy");
PDF_continue_text(p, "2010 better!");
PDF_end_page_ext(p, "");
PDF_end_document(p, "");
}
PDF_CATCH(p) {
printf("PDFlib exception occurred in hello sample:\n");
printf("[%d] %s: %s\n",
PDF_get_errnum(p), PDF_get_apiname(p), PDF_get_errmsg(p));
PDF_delete(p);
return(2);
}
Ч¹ûÈçÏ£º
37114
3¡¢²Î¿¼×ÊÁÏ
¡¾1¡¿PDF¸ñʽÏê½âhttp://blog.csdn.net/bobob/archive/.../23/751381.aspx
¡¾2¡¿PDFÎļþ¸ñʽhttp://ironsoft.cnblogs.com/archive.../05/311467.html
¡¾3¡¿PDFLib8ÏÂÔصØÖ·£º http://www.pdflib.com/download/pdflib-family/pdflib-8

¸½¼þÏÂÔØ£º
1¡¢±¾ÎÄÎÄÕ£º37115
2¡¢¹¤³ÌÔ´Â룺37116
3¡¢¿âÎļþ£º37117
__________________
½èÓôïÀʱ´¶ûµÄÃûÑÔ£ºÇ°½ø°É£¬Äã»áµÃµ½ÐÅÐÄ!
[url="http://www.dimcax.com"]¼¸ºÎ³ß´çÓ빫²î±ê×¼[/url]
huangyhgÀëÏßÖÐ   »Ø¸´Ê±ÒýÓôËÌû
GDT×Ô¶¯»¯ÂÛ̳£¨½öÓοͿɼû£©
»Ø¸´


Ö÷Ì⹤¾ß ËÑË÷±¾Ö÷Ìâ
ËÑË÷±¾Ö÷Ìâ:

¸ß¼¶ËÑË÷
ÏÔʾģʽ

·¢Ìû¹æÔò
Äú²»¿ÉÒÔ·¢±íÐÂÖ÷Ìâ
Äú²»¿ÉÒԻظ´Ö÷Ìâ
Äú²»¿ÉÒÔÉÏ´«¸½¼þ
Äú²»¿ÉÒԱ༭ÄúµÄÌû×Ó

vB ´úÂ뿪Æô
[IMG]´úÂ뿪Æô
HTML´úÂë¹Ø±Õ



ËùÓеÄʱ¼ä¾ùΪ±±¾©Ê±¼ä¡£ ÏÖÔÚµÄʱ¼äÊÇ 08:27 AM.


ÓÚ2004Äê´´°ì£¬¼¸ºÎ³ß´çÓ빫²îÂÛ̳"ÖÂÁ¦ÓÚ²úÆ·¼¸ºÎÁ¿¹«²î±ê×¼GD&T | GPSÑо¿/CADÉè¼Æ/CAM¼Ó¹¤/CMM²âÁ¿"¡£ÃâÔðÉùÃ÷£ºÂÛ̳ÑϽû·¢²¼É«Çé·´¶¯ÑÔÂÛ¼°ÓйØÎ¥·´¹ú¼Ò·¨ÂÉ·¨¹æÄÚÈÝ£¡Çé½ÚÑÏÖØÕßÌṩÆäIP£¬²¢ÅäºÏÏà¹Ø²¿ÃŽøÐÐÑÏÀ÷²é´¦£¬ÈôƒÈÈÝÓÐÉæ¼°ÇÖȨ£¬ÇëÁ¢¼´ÁªÏµÎÒÃÇQQ:44671734¡£×¢£º´ËÂÛ̳Ðë¹ÜÀíÔ±ÑéÖ¤·½¿É·¢Ìû¡£
»¦ICP±¸06057009ºÅ-2
¸ü¶à